xxxxxxxxxx
19
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
let w = width / 10,
h = height / 10;
for (let x = 0; x < 20; x ++) {
for (let y = 0; y < 20; y ++) {
if (x % 2 == 0 && y % 2 == 0 || x % 2 == 1 && y % 2 == 1) {
fill('red');
} else {
fill('blue')
}
rect(x * w, y * h, w, h);
}
}
}