The "Repeat" Block
CreatiCode last edited by
- The “Forever” Block
We often need to make a sprite repeat some actions a few times. For example, to make a dog spin around, we need to make it turn right 4 times:
We can make this program simpler using the repeat X times block.
This block will repeat any other block in its “mouth” by a number of times:
For example, we can rewrite the above program this way:
Clearly, this new program is simpler to write, and also easier for others to understand.
Imagine we need to turn the dog 1000 times, the program would be much longer without the repeat block!