size(400,400); // Sets the canvas too 400 x 400 pixels background(100,0,0); stroke(255); int a=10; do { println("a is now: "+a); a=a-1; } while(a>0); // The above is the same as this: for(int i=10; i>0; i=i-1) { println("i is now: "+i); } // Run loop random number of times int run=0; do { run++; println("run "+run+" times"); } while(random(100)>5); run=0; while(random(100)>5) { run++; println("run "+run+" times"); }