xxxxxxxxxx
30
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0,0,255);
for (let i = 0; i < 10; i++) {
for (let j = 0; j < 10; j++) {
if (j % 2 == 0) {
if (i % 2 == 0) {
fill(0);
}
else {
fill(255);
}
}
else {
if (i % 2 == 0) {
fill(255);
}
else {
fill(0);
}
}
rect(i * 40, j * 40, 40, 40);
console.log(i, j);
}
}
noLoop();
}