xxxxxxxxxx
37
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255, 255, 200);
noStroke();
/*
for (let x = 0; x <= width; x++) {
if (x % 3 == 0) {
fill(0, 0, 200);
} else {
fill(255, 0, 0);
}
ellipse(x * 20, 10, 10, 10);
}
*/
for (let x = 0; x < width; x = x + 20) { // outer for loop
fill(0, 0, 200);
for (let y = 0; y <= height; y = y + 20) { // inner for loop
if (y % 40 == 0) {
fill(255, 0, 0)
} else {
fill(0,0,0)
}
ellipse(x, y, 10, 10);
} // end y for loop
} // x for loop
}