4.2.4 Repeat until
View
The
block or “Repeat
Until ()” block is a Control block and a C block. Blocks inside this block
will repeat until the specified statement or condition is performed. After
what, the code beneath the C block (if any) will execute. This loop is similar
to a “while” loop used in other programming languages.
For example, in the following example, the code in the loop will run, repeatedly, as long as a variable (i) is less than 10:
The above codes do the same thing as the “Repeat Until ()” block in Scratch. The above code will allow the function to continue as long as the number is less than 10.
Last modified: Wednesday, 29 September 2021, 4:55 PM