For-downto loop
Now we have drawn shapes that have grown. At times, however, we may find ourselves in the opposite principle - drawing shapes from the biggest to the smallest, that is, the value of the control variable will decrease. This is achieved by replacing the reserved word to (step + 1) with the word downto (step - 1) in the For-loop. In this case, it is true that the initial limit is greater than the final limit so that the loop is at least once executed.
In the following example we want to draw 8 expanding circles. If we have used the reserved word to in the For-loop, the bigger circle would always overlap the smaller one, which we do not want to happen, therefore we use the downto keyword. The syntax of the entry remains invariable (Figure 58).
Note that before the For-loop, we set the pen thickness that is not changing during the loop run (because it was not a part of repeated commands in the body of the loop). Within the loop we have used the variable A, by which we shortened the individual circles, so that each following circle is 15 pixels smaller than the previous one (Figure 59).
Try to create another program in which you do not use the variable A, but the control variable I and compare the differences.