xxxxxxxxxx
34
let squares = [];
function setup() {
createCanvas(400, 400);
rectMode(CENTER);
colorMode(HSB);
for(let i = 0; i < 50; i++){
let sq = new Rectangle(random(width),
random(height),
random(20, 50),
random(150, 250)
)
squares.push(sq);
}
}
function draw() {
background(220);
for(let s of squares){
s.display()
}
}