xxxxxxxxxx
21
function setup() {
createCanvas(400, 400);
let foo = 7;
}
let x = 0;
let direction = 3;
function draw() {
background(240);
ellipse(x, height / 2, 20);
x = x + direction;
if (x > width || x < 0) { // || means logical OR
direction = -direction;
let y = 9;
}
print(y);
}