Repeating commands

Sometimes you will want the simulator to carry out a list of commands several times. For example you can make the symbol move around a square by pressing:-

The symbol can make the same movements if you tell it to repeat forwards 50 units and turn right 90 degrees four times. This is the program:-

stands for RePeaT. The key needs to be followed by the number of times the commands are to be repeated. The list of commands to be repeated must be followed by the key. Each needs a matching to tell PIP when to stop repeating.

We can repeat groups of commands that are to be repeated. So, to move in a square three times press:-

The simulator can use a inside a sequence, inside a sequence, but it cannot "nest" any deeper than this.

There must be a matching for every , or you will get an error message and grumble when the simulator finds the mistake.

You will get an error message if you try and "nest" 's too deeply.

Date Last Modified: 11/9/01