Processing Workshop 2 – ‘While loops’

Processing.org’s reference page on ‘While’ loops says:

“Controls a sequence of repetitions. The while structure executes a series of statements continuously while the expression is true. The expression must be updated during the repetitions or the program will never “break out” of while.”

The computer is basically always going to execute whatever is in the ‘while’ while that thing is true, for example:

task2sc1

 

‘while’ the number of circles is more than 0, the float, fill and ellipse commands will always execute, until the loop is broken by the ‘numberOfCircles’ function that maxes out the circles at 1o.

 

 

 

task2sc

Pretty stuff.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s