xxxxxxxxxx
var rows = 9;
var rows = 9;
var cols = 9;
var circleDiameter = 40;
var distanceX = 60;
var distanceY = 60;
function setup() {
createCanvas(600, 600);
noStroke();
}
function draw() {
background(0);
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
if (r%2==1) {
fill(200, 0, 0);
// or if (r == 1 | r == 3 | r == 5 | r == 7) {
} else {
fill(0, 200, 0);
}
ellipse(c * distanceX + distanceX, r * distanceY + distanceY, circleDiameter, circleDiameter);
}
}
}