xxxxxxxxxx
28
function setup() {
createCanvas(530, 530);
textFont("Arial");
}
function draw() {
background(255, 196, 56);
textSize(32);
textAlign(CENTER, CENTER);
// distance between squares
let jump = 30;
fill(255, 196, 56); //BG colour
// 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 < 20; y++) {
for (let x = 0; x < 10; x++) {
rect(x * jump + 10, y * jump + 10, 54, 46);
}
}
}