Friday, 27 May 2011

Final 200-300 word Description

If/else statements

In order to control how a program treats processes, the program uses a code called if/else statements. The statements include the code which determines when something will happen (if), what will happen and/or the alternative animation (else).
      
e.g.    if (something is true)
                      run a block of code

These are effective when creating animations and are especially useful when creating an interactive animation using mouse pressed functions and other codes allowing you to control the animations.

I have created what I call the sorting cube. What this cube demonstrates is the process of the if/else statements and the idea that there is a determinant which controls the next action. In my models case the determinant for the if/else statements is the slides. The slides that are inserted will determine which balls will fall to the bottom of the cube. There are 3 different sizes of balls at the top of the cube. If you insert one of the coloured slides it will affect the placement of the balls.

For example:  If the red slide is inside the cube, the red balls will fall through; else the red balls will not hit the bottom.

                If (the red slide is inserted in the cube and the black slide is not)
                 
the red balls will fall to the bottom

                Else the red balls will continue to sit at the top of the cube.


No comments:

Post a Comment