xxxxxxxxxx
21
var x1, x2, y;
function setup() {
createCanvas(600, 400);
}
function draw() {
background(220);
noFill();
noStroke();
if (mouseX < width / 3) {
fill("red");
rect(0, 0, width / 3, height);
} else if (mouseX > width / 3 && mouseX < 2 * width / 3) {
fill("red");
rect(width / 3, 0, width / 3, height);
} else {
fill("red");
rect(2 * width / 3, 0, width / 3, height);
}
}