xxxxxxxxxx
29
const squareSize = 40;
function setup() {
createCanvas(800, 600);
noLoop();
}
function draw() {
background(220);
for( let row = 0; row < width/squareSize; row++ ){
for( let col = 0; col < height/squareSize; col++ ){
let n = noise( row * 0.2, col * 0.1 )
if( n < 0.6 ){
fill(255)
}else if ( n < 0.7 ){
fill(100)
}else{
fill(50)
}
rect( row*squareSize, col*squareSize, squareSize, squareSize )
}
}
}