xxxxxxxxxx
32
/*
Based on Herbert W. Franke's Random Square
http://dada.compart-bremen.de/item/artwork/1265
*/
let seed = 200;
function setup() {
createCanvas(windowWidth, windowHeight);
rectMode(CENTER);
noFill();
stroke(255);
strokeWeight(2);
}
function draw() {
background(0);
randomSeed(seed);
for (let i = 0; i < 400; i++) {
let x = random(width / 10, (width / 10) * 9);
let y = random(height / 10, (height / 10) * 9);
let w = random(width / 10, width / 40);
let h = random(height / 10, height / 40);
rect(x, y, w, h);
}
}
function mousePressed() {
seed = random(2000);
}