+21622886281
Scratch

Control Blocks in Scratch

In Scratch, control blocks are blocks of code that allow you to control the flow of your program. They are used to create loops, control the order in which blocks are executed, and make decisions based on certain conditions.

Here are some examples of control blocks in Scratch:

  1. « Forever » block: This block allows you to repeat a set of blocks indefinitely.
  2. « If » block: This block allows you to execute a set of blocks if a certain condition is true.
  3. « Wait » block: This block allows you to pause the program for a specified amount of time.
  4. « Repeat » block: This block allows you to repeat a set of blocks a certain number of times.
  5. « Stop » block: This block allows you to stop a script or the entire program.

Control blocks are an essential part of programming, and they allow you to create more complex and interactive programs.

The block suspends its script for the specified number of seconds. The expectation can also be a decimal number.

The blocks inside this block will loop a number of times, before allowing the script to continue. If a decimal is inserted, the number is rounded.

Blocks held inside this block will be in a loop.

Just like the Repeat() block and the Repeat Until() block, except the loop never ends (unless the stop sign is clicked, the Stop All block is enabled, or the d script block stop is activated in the loop).

The block will check its boolean condition. If the condition is true, the blocks contained inside will execute, then the script involved will continue. If the condition is false, the code inside the block will be skipped and the script will continue (unlike the if() then, else block). The condition is only checked once; if the condition becomes false while the script inside the block is running, it will continue to run until it is finished.

The block will check its boolean condition: if the condition is true, the code contained in the first C (space) will be activated, then the script will continue; if the condition is false, the code inside the second C will activate (unlike the if() else block).

The block suspends its script until the specified boolean condition is true.

Blocks within this block will loop until the specified boolean statement is true, in which case the code under the block will execute.

This block stops all scripts in all sprites

It activates in a clone when it is created.

It creates a clone of the sprite in the argument. It can also clone the sprite it is running in, creating clones of clones, recursively.

It deletes the clone it is running in. This block is the only way besides clicking the green flag or stop sign to remove clones.




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top