xxxxxxxxxx
22
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
let x = 0;
while (x < width) {
if (mouseX > x && mouseX < x + 20) {
fill("red");
} else {
fill("white");
}
rect(x, 0, 40, height);
x += 20; // t x to move to the next column
}
}