Thursday, June 3, 2010

Two Ways to Loop

Two Ways to Loop

There are two commands that can make other commands repeat.
Loop makes the commands repeat indefinitely:

to beepForever
loop [beep wait 2]
end

Repeat makes the commands repeat as many times as you tell it to:

to beepFiveTimes
repeat 5 [beep wait 2]
end

No comments: