Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    The "Repeat" Block

    2D Blocks
    1
    1
    316
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

      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!

      1 Reply Last reply Reply Quote 0
      • Pinned by  info-creaticode info-creaticode 
      • First post
        Last post