//nest loop //let variable=random(1) //if<0.5 else let gridsize; function setup() { createCanvas(windowWidth, windowHeight); } function draw() { gridsize=width/10 let x; let y; for(x=0;x<width;x+=gridsize){ for(y=0;y<height;y+=gridsize){ let seed=random(1); noStroke(); if (seed<0.5){ fill (0); }else{ fill(255); } rect(x,y,gridsize)} } noLoop(); } function windowResized() { resizeCanvas(windowWidth, windowHeight); }