Learn to Program with ZedLX

Free Online Programming Course for Beginners

Simple Motion [2/10]

The clearScr procedure resets the text output position to the the top left corner. As a consequence, the last println statement of this program outputs the text at the top left corner.
[Run the program]

The clearScr procedure also sets the global background color. Intially, the global background color is black.

The println statement uses the global background color, although that cannot be discerned in this example. For the text output, println uses the global foreground color.

Exercise:

  1. Replace both clearScr procedure calls with fillScr procedure calls to see the difference between them.

Loading...