void setup(){ size(800,500); } void draw() { //do some drawing background(0); // Box widths and positions. int x1, x2, y1, y2, swidth; x1 = int(random(width)); x2 = int(random(width/2)); y1 = int(random(height)); y2 = int(random(height/2)); swidth = int(random(50)); // Box and border colours. int c1, c2, c3, sc1, sc2, sc3; c1 = int(random(255)); c2 = int(random(255)); c3 = int(random(255)); sc1 = int(random(255)); sc2 = int(random(255)); sc3 = int(random(255)); stroke(sc1, sc2, sc3); strokeWeight(swidth); fill(c1,c2,c3); rect(x1,y1,x2,y2); } // line(x1,y1,x2,y2); //first two coordinates are the top left corner (the origin)