Loops in Scratch

Scratch has three different types of loop blocks: forever, repeat and repeat until.

In this activity, we will focus on the forever and repeat blocks.

Change the blocks that makes your Cat dance to look like the blocks below:


This will make the Cat dance forever (or until you click the red stop icon next to the green flag).

We don't want the Cat to dance forever, and so we will use a repeat block instead.

Change the blocks so they look like this instead:


We are now using a repeat loop block, instead of a forever loop block.

The repeat block has a slot for a number (2 in the example above), which determines how many times the actions in the loop repeat.

Now the Cat repeats the movement back and forth twice and the drum sound is played 4 times.

Try changing the 2 in the repeat loop block to different numbers and clicking the stack of blocks.

What happens when you use larger numbers (for example: 10)?

What happens when you use numbers like 0 and -1 in the repeat block and click on the stack of blocks?


Views
1 Total Views
1 Members Views
0 Public Views
Share on Social Networks
Share Link
Share by mail

Please login to share this webpage by email.