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

Follow and fix steps

Week 1 · Unit 1: Making programs clear · 3 lessons
1

Follow every step

Computing 3: Unit 1, pp. 8–27
GoalFollow an algorithm one step at a time to find out where it leads.
New words
algorithm · a list of steps, in the right order, that solves a problemstep · one instruction in an algorithmfollow · to do the steps exactly, one at a time, in order
Explanation

An algorithm is a list of steps. The steps must be in the right order. To check an algorithm, follow it one step at a time, just as a computer does. Do not skip a step and do not guess. Put a finger on the start square, do step 1, then step 2, and so on. When the last step is done, look at where you are. Only then can you say whether the algorithm works.

1 wake up2 brush teeth3 get dressed4 walk to school
Worked examples
schoolshop
A girl starts at the bottom-left square. Her algorithm is: 1 Move 2 squares right. 2 Move 3 squares up. 3 Move 1 square right. After step 1 she is two squares along the bottom. After step 2 she is at the top. After step 3 she reaches the school.
A computer does exactly what each step says. If a step says “Move 2 squares”, it moves exactly 2 squares, not 1 and not 3. That is why we must read every number and every direction with care.
house
Another algorithm: 1 Move 4 squares right. 2 Move 2 squares up. Starting at the bottom-left, the robot goes along the bottom row and then up two squares. It stops at the house.
Class activity

Human robot (with a friend): draw a grid of squares on the floor with chalk or strips of paper, 5 squares wide and 4 tall, or draw it on squared paper and use a coin. Your friend writes an algorithm of three or four steps, such as “Move 2 squares right, Move 1 square up”. Follow it one step at a time and stand on, or place the coin on, the end square. Your friend checks. Then swap jobs.

Practice
1
Follow this algorithm from the start square. Where does the robot finish: the flower, the tent or the shop? 1 Move 3 squares right. 2 Move 2 squares up. 3 Move 1 square left.
flowertentshop
2
A child follows this algorithm: 1 Put on socks. 2 Put on shoes. A friend does step 2 first. What goes wrong?
socksshoes
3
Write an algorithm that takes the robot from the start square to the star. Use steps like “Move 2 squares right”.
star
4
The robot starts in the bottom-left square and follows this algorithm. How many squares does it move in all? In which row does it stop?
StepInstruction
1Start
2Move 2 squares right
3Move 1 square up
4Stop