AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

From steps to blocks

Week 2 · Unit 1: Be a game developer · 3 lessons
3

Spin and say

Computing 2: Unit 1, pp. 8–23
GoalRead, write and check programs that move, spin and say something, and tell which algorithm is more precise.
New words
say · a block that shows a speech bubbletest · to run a program and check that the result is rightprecise · exact, clear and correct
Explanation

A program can do more than one thing. A character can spin and then say something. The blocks run from left to right, one after the other. Here a parrot makes a half turn and then says “Hello!”. Always test your program. Does the result match the algorithm? If not, there is a mistake to find and fix.

6Hello!start ontapturnrightsayend
Worked examples
12Ta-da!
A rabbit spins once and then says “Ta-da!”. Spin right 12 is one whole turn, and the say block comes after it.
12start ontapturnleftend
Spin left 12 is also a whole turn, but the other way round. The left and right blocks have arrows that curl in different directions.
3turnleft
Ella’s algorithm says “Spin”. The computer cannot know which way or how far. “Spin left 3” is precise: it says left, and 3 is a quarter turn.
Class activity

Test and fix: write this algorithm on a card for a friend: 1 Start. 2 Clap 2 times. 3 Spin left 3. 4 Say “Ready!”. 5 Stop. Your friend does each step in order. Then change just one step, for example spin left 6, and watch what is different. Which steps were easy to follow? Which needed a number to be precise? If you have a computer or tablet, build a program like it in ScratchJr with an adult.

Practice
1
Which program makes a character spin around two whole times?
A12B24C6
2
The algorithm says spin LEFT 12. Which block is wrong?
12
3
Write the algorithm for this program.
Hi!6
4
An algorithm says: 1 Start on tap. 2 Move right 4. 3 Stop. It should also make the character say “Wow!” at the end of the move. Which step must be added, and where?