top of page

Algorithm Example

​

Algorithm.png

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.

​

©2020 by Thomas' CSP Website. America is the best country in the history of the world!

bottom of page