xxxxxxxxxx
52
function setup() {
createCanvas(800, 800);
noLoop();
}
function draw() {
background(255);
let cellSize = 100;
let rows = height;
let cols = width;
for (let x = cellSize; x < rows+cellSize ; x += cellSize) {
for (let y = cellSize; y < cols+cellSize; y += cellSize) {
fill(255);
/*
if ( x > 100 && x < 300 ) {
fill(255,0,0);
}
if ( x > y % (cellSize*5) ) {
fill(255,0,0);
}
*/
if (x>100 && x < 800 && y>300 && y < 500 ) {
fill(255,0,0);
}
rect(x - cellSize, y - cellSize, cellSize, cellSize);
}
}
}