top of page

Abstraction Example

​

Abstraction2.png
Abstraction1.png

The right image shows the paddle.draw() function, which creates the paddle and controls its mechanics. The left image shows where the paddle.draw() function is called in the main loop of our code. Abstraction makes the execution of this command very easy. Because this function repeats over and over again infinitely, abstraction reduces the lines of code to execute this function down to one, as shown in the left image. 

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

bottom of page