If ( something is true ) then {
do this
}
otherwise if ( something else is true ) then {
do this instead
}
otherwise {
do this instead
}
This is my understanding of how If/Else works, or rather, how If / Else If / Else works.
The Littlest Robot uses a count system. ( Each time through the If/Else loop, the count is incremented (+1)).
By modifying the condition of the if statement, the whole 'story' is changed. Each change is dictated by the count or by 'how long the code has been running'. By changing the condition of when events occur, the story becomes changes, affecting the order of events and when they occur.
The Dungeon uses a user initiated If/Else system. By clicking certain 'buttons', the if/else triggers different events (or pages in this case,)  based on the previous events (or page). This is a very good example of If/Else.
Alice and Mad Hatter's Maze is very simlar to the dungeon. It uses mouseOver to highlight when clicking the mouse will trigger an event. Not as in depth or interesting, but still shows the basis of the If/Else.
Zombie in Wonderland . Very similar to the previous 2, but text based only. Very interesting though. The dungeon is based on this code.
Modifying either of the previous 3 codes just messes with the program. It just stops working or stops making sense.
No comments:
Post a Comment