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

2. 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...