Answer:

' Draw 10 Red Balloons each with a GREEN string
' The balloons hover above the  brown earth.
' The program will wait one second after drawing each balloon-and-string.
'
SCREEN 12                    ' start up graphics
'
LET BALLOON = 1              ' start with balloon number 1
DO WHILE BALLOON <= 10       ' end with balloon number 10
  LET X = BALLOON * 64 - 32  ' calculate an X for this balloon
'
  COLOR 4                    ' set the pen color to red
  CIRCLE (X, 100), 25        ' draw a balloon
'
  COLOR 2                    ' set the pen color to green
  LINE  (X, 125) - (X,225)   ' draw its string
  SLEEP 1                    ' wait one second before going on
  LET BALLOON = BALLOON + 1  ' go on to next balloon
LOOP
'
COLOR 6                      ' set the pen color to brown
LINE (0, 240)-(639,240)      ' draw a line across the screen
END

There are actually many places where the new SLEEP statement could go, but it makes sense (to me, at least) to put it after the last line of each balloon-and-string is drawn.

End of Chapter

That is the end of this chapter. You may wish to review the following. Click on a term that interests you to go to where it was discussed.

The next chapter will continue the discussion of loops. You will learn how to write loops that make more complicated decisions about when to stop executing the loop body.

You have reached the end of the chapter.

go to previous page   go to home page