xxxxxxxxxx
22
//while loop
let x, h;
function setup() {
createCanvas(500, 500);
w = width / 20;
}
function draw() {
x = 0;
while (x < 500) {
if (mouseX >= x && mouseX < x + w) {
fill("red");
} else {
fill("white");
}
rect(x, 0, w, height);
x += w;
}
}