beautypg.com

Picobotz – Elenco Picobotz User Manual

Page 13

background image

PICOBOTZ

PICOBOTZ

© iBOTZ (Ireland) Limited.2004.

No part of this manual may be reproduced with express permission of iBOTZ (Ireland) Limited

.

13

In this Activity, you will learn about Repeat loops.

In the previous program, there were four Forward instructions. It can often be more convenient to
use a Repeat loop.

Click the Repeat button to select the Repeat Programming page:


Click on the "Repeat N times" radiobutton. The upper part of the page has instructions for a
Repeat loop which repeats a fixed number of times. Edit the program from Activity 8 so it is like
this:


Download and run the program. The robot should behave as it did before.

The robot has only three "repeat" counters so "Repeat N times" instructions may only be nested
up to three deep. Other blocks (While, Repeat, If) may be nested to any depth. For instance:

Repeat 4 times

Repeat 6 times

Repeat 2 times

Repeat 2 times

End

End

End

End

Is illegal - the Repeat-End blocks are nested four deep. But this: