Code your way_Week3-2
Thu Feb 09 2023 02:46:13 GMT+0000 (Coordinated Universal Time)
Saved by
@yc_lan
// grid
// add amount to y
let gridWidth,gridHeight;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(255);
gridWidth=width/20
gridHeight=height/3
for(x=0;x<=width;x+=gridWidth+10){
for(y=0;y<3;y++){
strokeWeight(2)
rectMode(CENTER);
rect(x,y*gridHeight+1/2*gridHeight,
gridWidth,gridHeight-height/15+random(-height/20,height/20))
}
}
noLoop();
}
content_copyCOPY
Comments