xxxxxxxxxx
19
function setup() {
createCanvas(400, 400);
noStroke();
let blockSize = 15;
for (let y = 0; y < height; y += blockSize) {
for (let x = 0; x < width; x += blockSize) {
let rand = random(1);
if (rand > 0.5) {
fill(255);
square(x, y, blockSize);
} else if (rand < 0.5) {
fill(0);
square(x, y, blockSize);
}
}
}
}