Navigation

    CreatiCode Scratch Forum

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

    The "Repeat Until" Block

    2D Blocks
    1
    1
    264
    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

      • Working with Blocks

       

      Description

      The “repeat until” block is a C block with boolean input in the control category.


       

      How does this block work?

      This block will keep repeating the blocks inside it until a condition becomes true. In other words, this block will check the condition first, and if the condition is not true, it will run all the blocks inside its "mouth’ once, then it checks the condition again. If the condition is still not true, then the blocks inside will run again …


       

      If the condition is already true

      If the condition given to the “repeat until” block is already true, then the blocks inside will NOT run at all.


       

      Animation with “Repeat until” Block

      Here is how you can create an animation with repeat until block. Since the butterfly is not touching the flower, the condition is false for the repeat until block in the beginning. Therefore, the blocks inside will make the butterfly move down repeatedly. When the butterfly becomes touching the flower, the condition becomes true. At that time, the blocks below the “repeat until” block will run instead.


       

      1 Reply Last reply Reply Quote 0
      • First post
        Last post