Monday, 2 May 2011

Project 3 - Coding Exhibition

At this stage I'm going to go with Loops. Possibly a while loop. But maybe more of an If/Else.

Processing Description of While:

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.

This function can be dangerous because the code inside the while() loop will not finish until the expression inside while() becomes true. It will lock out all other code from running (mouse events will not be updated, etc.) So be careful because this can lock up your code (and sometimes even the Processing environment itself) if used incorrectly.


Processing Description of If:

Allows the program to make a decision about which code to execute. If the test evaluates to true, the statements enclosed within the block are executed and if the test evaluates to false the statements are not executed.

Processing Description of Else:

Extends the if() structure allowing the program to choose between two or more block of code. It specifies a block of code to execute when the expression in if() is false.

Processing Description of For:
 
Controls a sequence of repetitions. A for structure has three parts: init, test, and update. Each part must be separated by a semi-colon ";". The loop continues until the test evaluates to false. When a for structure is executed, the following sequence of events occurs:
1. The init statement is executed
2. The test is evaluated to be true or false
3. If the test is true, jump to step 4. If the test is False, jump to step 6
4. Execute the statements within the block
5. Execute the update statement and jump to step 2
6. Exit the loop.

The only idea I have at this stage is moshing (headbanging) being a metaphor for a loop of some sort.

No comments:

Post a Comment