Modulus Animation

In this program, you'll use a loop to draw a simple ASCII-based animation on the screen, and you will use modulus (%) to determine which frame of the animation to show. (You will learn how to create your own loops later.)

Files Needed

(Do not re-type any of these files. Simply download a copy of each file by right-clicking and choosing "Save link as..." from the context menu. Save them into your normal code folder.)

What You Should See

If you download, compile and run it will look roughly like this.


(It will look cooler while it's running.)

Study Drills

  1. Add several if statements in so that it draws a little animation of your choosing. You must have a minimum of eight (8) different frames of animation, and it must loop smoothly.

©2013–2015 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License