xxxxxxxxxx
22
let size = 50;
let cols = 4; let rows = 4;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
for (let i=0; i<cols; i++) {
for (let j=0; j<rows; j++) {
fill(255);
let x = width/2 - size*cols/2 + size/2;
let y = height/2 - size*rows/2 + size/2;
ellipse(x + i*size, y + j*size, size, size);
}
}
fill(255, 0, 0);
ellipse(width/2, height/2, 10, 10);
}