Reusable blocks and loops
Answers are for parents and teachers.
1
Write your own three-move dance (for example clap, turn, bow) as a sub-routine called “my dance”. Then write two short scripts on paper that both call it.
For example: define [my dance] holds the three moves. Script 1: when 1 is pressed, step forward, my dance. Script 2: when 2 is pressed, step back, my dance.
2
Write an algorithm with a repeat step, for a robot that claps and then stamps. It must do this 5 times in all. Then write the number that goes in the Scratch repeat block.
For example: 1 Start. 2 Clap. 3 Stamp. 4 Repeat steps 2 and 3 four more times. The repeat block says 5.
3
A program has repeat (6). Inside the loop it waits 0.5 seconds and moves 10 steps. How long does it take, and how far does the sprite move?
6 × 0.5 = 3 seconds, and 6 × 10 = 60 steps.
4
Make a test table with three rows for a simple game idea of your own (for example “press the space key”). Write the expected result for each row.
Any three clear tests, each with a key press or a click, and an expected result that can be checked.
5
(if you have a computer or tablet) Open Scratch with a grown-up. Make a block in My Blocks called “wiggle” and use it in two scripts. Does changing it once change both?
Yes. Both scripts use the same define block, so a change in the define block changes both.