top of page

Algorithm Example
​

The image on the left is an example of an Algorithm in our program. This specific Algorithm evaluates the location that the ball hits on the paddle, and makes appropriate choices depending on this location. The first IF statement evaluates whether the ball has hit the paddle. If so, the following IF statements determine the specific location that the ball hits, and return numbers varying from 2-4 depending on its location. These numbers come into play through another function, eventually controlling the energy return from the ball hitting these specific locations on the paddle.
​
bottom of page