xxxxxxxxxx
54
/*
Assemble and modify:
1. Unscramble and assemble the code to create something like this:
https://printablee.com/postpic/2015/04/free-printable-grid-paper_18888.png
2. Add some random variation, for example:
- Change some of the elements to be different from the others
- Or maybe all the elements are different from each other
- Or replace some elements with an entirely new one
*/
let z = 0;
let cellSize;
function setup() {
createCanvas(windowWidth, windowHeight);
noFill();
strokeWeight(2);
frameRate(10);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
function draw() {
background(255);
cellSize = min(width / 10, height / 10);
for (let x = 0; x < width; x += cellSize) {
for (let y = 0; y < height; y += cellSize/10) {
fill(noise(z+10)*255,noise(z+50)*255,noise(z+100)*255);
square(x, y, cellSize);
z += 0.1;
}
}
}