Code the algorithm
Answers are for parents and teachers.
1
Write the blocks for this algorithm: 1 When the green flag is clicked. 2 Switch costume to fish-a. 3 Go to x: −90, y: 30.
when green flag clicked, switch costume to [fish-a v], go to x: (−90) y: (30).
2
Name the input and the outputs of this algorithm.
| Step | Instruction |
|---|---|
| 1 | When the left arrow key is pressed |
| 2 | Start sound Whoosh |
| 3 | Change x by −30 |
The input is the left arrow key. The outputs are the sound Whoosh and the move 30 steps to the left.
3
A penguin has two algorithms. Write both: a reset (input: green flag; outputs: costume penguin-a and the place x: 50, y: −70) and an action (input: click; outputs: the penguin says “Brr!” for 2 seconds).
Reset: when the green flag is clicked, switch costume to penguin-a, go to x: 50, y: −70. Action: when this sprite is clicked, say “Brr!” for 2 seconds.
4
A script says “Good morning!” for 3 seconds, waits 2 seconds, starts a sound (which takes no time) and then says “Bye!” for 4 seconds. How long does it take?
3 + 2 + 0 + 4 = 9 seconds.
5
(if you have a computer or tablet) Build the plane and cloud program from lesson 3 in Scratch. Test it as in the examples. Does the cloud change when the plane arrives?
Yes: the plane glides for 3 seconds and the cloud waits 3 seconds before it changes to cloud-b.