xxxxxxxxxx
14
function setup() {
createCanvas(300, 300);
let foo = 50; // create and initialize a variable
while (foo < width) { // keep going as long as the condition is true
ellipse(50, foo, 40, 40);
ellipse(100, foo, 40, 40);
ellipse(200, foo, 40, 40);
ellipse(150, foo, 40, 40);
ellipse(250, foo, 40, 40);
// modify the variable so something different happens next time
foo = foo + 50;
}
}