Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Simple Motion [9/10]

This program animates a line.
[Run the program]

Exercises:

1. Remove the clearScr statement from the program or comment it out behind symbols <<.
[Run the program]

The screen will start to scroll because of the println statement. This creates an interesting effect.

2. Add the statement fillScr(/black); as the first statement in the body of the loop.
[Run the program]

The screen will start to scroll again, but this will not be easily noticeable.

3. To stop the scrolling, a clearScr statement has to be used because it resets the text output position back to the top left corner of the screen. Add back a clearScr statement.
[Run the program]

4. Remove the println statement from the program, and also remove all fillScr and clearScr statements. Run the program again.

Loading...