Learn to Program with ZedLX

Free Online Programming Course for Beginners

Simple Graphics [3/15]

The step of the for loop is -50, and the initial value (800) is greater than the bounding value (100). This causes the discs to be drawn from right to left.
[Run the program]

Exercises:

  1. Insert the statement println "x: ", x; just above the disc procedure call, inside the loop's body.
    [Run the program]

  2. Change the argument of the sleepMs procedure call to value 500.
    [Run the program]

  3. Increase the spacing between the discs.

After solving an exercise, it's a good idea to review it by comparing to the the provided solution.

Note that there may be multiple correct solutions, so the provided solution might not match exactly with your solution.

Solution

for #x=800..100 -=75

Loading...