Learn to Program with ZedLX

Free Online Programming Course for Beginners

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 /// or <<.
    [Run the program]

    The screen will be scrolled by the println statement. It creates an interesting effect.

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

    The screen be scrolling nevertheless, but this will not be easily noticeable.

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

  4. Remove the println statement from the program, and also remove all calls to fillScr and clearScr procedures.
    [Run the program]

Loading...