xxxxxxxxxx
24
const GRID_SIZE = 10;
let randomLimit = 3;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
rectMode(CENTER);
noLoop();
}
function draw() {
background(255);
let rectSide = width/GRID_SIZE;
// background(220);
for (let i = 0; i < GRID_SIZE; i+= 1) {
for (let j = 0; j < GRID_SIZE; j +=1) {
push();
translate(rectSide/2 + i*rectSide, rectSide/2 + j*rectSide);
rotate(j*random(-randomLimit,randomLimit));
rect(0, 0, rectSide, rectSide);
pop();
}
}
}