xxxxxxxxxx
19
let cols;
let rows;
let resolution = 20;
function setup() {
createCanvas(400, 400);
cols = width / resolution;
rows = height / resolution;
}
function draw() {
background(220);
fill(255, 0, 0);
for (i = 0; i < rows; i++) {
for (j = 0; j < cols; j++) {
rect(j*resolution, i*resolution, resolution, resolution);
}
}
}