GoalTurn an algorithm into a program by matching a block to every step.
New words
block · one picture piece of coderun · to make a program start and do its jobspin · to turn around on the spot
Explanation
We make a program in four steps. First, break the task into parts. Second, write the algorithm. Third, match one block to each step and join the blocks with no gaps. Fourth, run the program and look at the result. If the result is wrong, check the algorithm and the blocks again. A spin is counted in twelfths of a full turn, so spin 12 is one whole turn.
Worked examples
Algorithm: 1 Start on the green flag. 2 Spin right 3. 3 Stop. The program has three blocks, one for each step.
Algorithm: 1 Start on the green flag. 2 Move up 2. 3 Move right 3. 4 Stop. The blocks are joined in the same order as the steps.
Turns are counted in twelfths. Turn 3 is a quarter turn. Turn 6 is a half turn. Turn 12 is a whole turn.
Class activity
Human program: stand up in a clear space. Spin right 3 means turn a quarter of the way round to your right. Try spin right 3, then spin right 6, then spin right 12. Which one brings you back to face the same way? Now write a 4-step algorithm for a friend, such as start, spin right 6, hop 2 times, stop, and watch your friend run it. If you have a computer or tablet, an adult can help you build it in ScratchJr.
Practice
1
How many whole turns is spin right 24?
Two whole turns, because 12 is one whole turn.
2
Is this a quarter turn, a half turn or a whole turn?
A half turn. 6 is half of 12.
3
Which block is missing? Algorithm: 1 Start on tap. 2 Move up 4. 3 Spin right 12. 4 Stop.
The spin right 12 block (turn right with 12 under it).
4
Put these in the right order: A run the program, B write the algorithm, C match the blocks, D break the task into parts.