|
Several loops are available to use so lets look at them
do loop - repeats unconditionally for next - a loop that ends at a predifined set point while loop - a loop that ends on a condition being true
The examples
rem do loop just keep repeating do print "hi" sync loop rem prints hi forever
rem loop 100 times for a = 1 to 100 print "hi" sync next a rem print hi only 100 times
rem loop until a condition is true a = 0 while a < 50 inc a,1 pint "hi" sync loop rem prints hi until a > 50
You'll need to experiment with the different loops and decide which you need based on what you want to do.
Expand on it
make a circle move across the screen with each type of loop
hint to make the circle disappear draw it black
this will teach you the limits of the loops and the differences between them
Back
|
|