// While Loop Example void setup() { size(400,400); stroke(255,0,0); // I like red.. strokeWeight(5); fill(0,0,255); // I like blue.. } void draw() { background(128); // Let's make a striped background int x = 0; while (x < width) // Just like an if statement but it keeeps happening until it evaluates to false { // Start the block of code for this while loop line(x,0,x,height); // Draw a line the entire height of the window and at the x point // Getting fancy /* if (mouseX > x - 5 && mouseX < x + 5) { // draw an ellipse ellipseMode(CORNERS); noStroke(); ellipse(x-5,mouseY-10,x+5,mouseY+10); stroke(255,0,0); // I like red.. strokeWeight(5); } else { line(x,0,x,height); // Draw a line the entire height of the window and at the x point } */ x = x + 10; // Increase the x variable by 10 every time through the loop // End the block of code for this while loop } }