xxxxxxxxxx
45
function setup() {
createCanvas(1080, 1080);
}
function draw()
//gridz
{
let n =3;
let w = width/n;
let h =height/n;
background(0);
fill(11, 128, 64)
strokeWeight(5)
let jump = 360;
// two for loops are needed to make a grid of squares
// the outer loop controls how many rows are made
// the inner loop controls how many columns are made
for (let y = 0; y < 3; y++) {
for (let x = 0; x < 3; x++) {
rect(x * jump + 3, y * jump + 3, 360, 360);
}
fill(200)
strokeWeight(5)
let gump = 120;
// two for loops are needed to make a grid of squares
// the outer loop controls how many rows are made
// the inner loop controls how many columns are made
for (let y = 0; y < 9; y++) {
for (let x = 0; x < 9; x++) {
rect(x * gump + 9, y * gump + 9, 120, 120);
}
}
}
}