xxxxxxxxxx
28
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
let n = 10;
for (let i = 0; i < n; i = i + 1){
for (let j = 0; j < n; j = j + 1){
let x = (i * (width/(n + 1)) + (width/(n + 1)));
let y = (j * (height/(n + 1)) + (height/(n + 1)));
let z = 10 + (i*2); // width of rectangle
let w = 10 + (i*2); // height of rectangle
noStroke();
fill( 20 + (i*30));
rectMode(CENTER);
rect(x,y,z,w);
}
}
noLoop();
}