xxxxxxxxxx
20
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
let tileSize = width/7;
for (let i = 0; i < width; i += tileSize) {
for (let j = 0; j < height; j += tileSize) {
if ((i / tileSize + j / tileSize) % 2 == 0) {
fill(random(0,60)); // Black squares
} else {
fill(random(160,255)); // White squares
}
rect(i, j, tileSize, tileSize);
}
}
}