Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:programmingblocks:loops [2018/05/09 09:40] – kniwwelino | en:programmingblocks:loops [2018/06/07 13:02] (current) – kniwwelino | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Loops ===== | ||
+ | ==== Repeat multiple times ==== | ||
+ | {{: | ||
+ | |||
+ | With this block you can repeat commands multiple times. Place the blocks to be repeated inside the loop. As soon as the program has accomplished the last block in the sequence, it will restart with the first block. | ||
+ | |||
+ | Options: | ||
+ | * The number of times the block or sequence of blocks should be repeated | ||
+ | |||
+ | Example: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | This example writes three times '' | ||
+ | |||
+ | \\ | ||
+ | ==== Repeat while ==== | ||
+ | {{: | ||
+ | |||
+ | With this block, you can add a condition to a loop. As long (or until) as the condition is true, the blocks inside the loop will be repeated. | ||
+ | |||
+ | Options: | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | \\ | ||
+ | ==== Count ==== | ||
+ | {{: | ||
+ | |||
+ | With this block you repeat a sequence of command blocks, and with each repetition, you change the value of a variable. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | In the first loop, '' | ||
+ | |||
+ | \\ | ||
+ | ==== Break out of loop ==== | ||
+ | {{: | ||
+ | |||
+ | This block needs to be placed inside a loop. It can, for instance, be bound to another condition. As soon as the block is reached, the program jumps to the first instruction after the loop. |