The "Repeat" Block
-
Prerequisite
- The “Forever” Block
Description
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.
The Repeat X Times Block
This block will repeat any other block in its “mouth” by a number of times:

Example
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!

-
I CreatiCode pinned this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login