Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Simple Graphics [2/14]

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

After running and examining the program, add a statement println "x: ", x; just above the disc statement. Then try out the new program.

Exercise:

Change the program so that the discs are drawn farther apart.

After you have solved an exercise, it is recommended to always examine the provided solution.

Note: Sometimes there can be multiple correct answers, so the provided solution may not match exactly with your solution.

Solution

for #x=800..100 -=75

Loading...