xxxxxxxxxx
26
let eDiam = 40;
function setup() {
createCanvas(windowWidth, windowHeight);
noLoop();
}
function draw() {
background(220, 20, 120);
for (let x = eDiam / 2; x < width + eDiam; x += eDiam) {
for (let y = eDiam / 2; y < height + eDiam; y += eDiam) {
let aRandomNumber = random();
if (aRandomNumber < 0.333) {
fill(0);
} else if (aRandomNumber < 0.666) {
fill(0, 215, 255);
} else {
fill(255, 215, 0);
}
ellipse(x, y, eDiam, eDiam);
}
}
}