Program a robot friend: algorithms with arrow cards
Pupils guide a partner across a floor grid with arrow cards. They learn that a program is a set of precise steps, and how to fix one that goes wrong.
Pupils will be able to
- Explain that an algorithm is a set of precise steps in order
- Write a short algorithm with arrow cards to reach a target
- Predict where a set of cards will take the robot before it moves
- Find and fix a bug in an algorithm
You will need
- A 5 by 5 floor grid, marked with masking tape or chalk, one for every group of four
- Arrow cards: forward, turn left, turn right (about 15 a group)
- A soft toy or beanbag for each grid, as the treasure
- A clear space where children can walk the grid safely
Children usually meet computers as things they tap, not things they tell what to do. In this lesson they become the programmers, with a classmate playing a robot that follows their cards exactly.
What pupils learn
The lesson builds the idea at the heart of Key stage 1 computing. A computer follows instructions exactly, in order, and does nothing it is not told. Pupils write an algorithm, watch it run, and fix it when it goes wrong. That covers three statements in the national curriculum, listed above, without a screen in sight.
It also prepares pupils for programmable floor robots and simple block-based programming apps. Those use the same forward and turn commands, so the ideas carry straight across.
Before the lesson
Mark one 5 by 5 grid for every group of four, with squares big enough for a child to stand in. Put the treasure on a square two or three moves from a corner. Make a set of arrow cards for each group: forward, turn left and turn right.
Decide the one rule you will be strict about. A turn happens on the spot. The robot turns to face a new way but does not move to a new square. Most early bugs come from children expecting a turn to move the robot as well.
The lesson, step by step
The timings below fit a 45-minute session, with a short gap at the end for tidying away
- Introduction, 5 minutes. Ask a confident volunteer to be the robot. Explain that robots cannot guess, so they only do exactly what the cards say.
- Modelling, 10 minutes. Lay out cards on the floor in a line, then say the plan aloud as you go. Ask the class to predict where the robot will end before it moves. Run it, then check the prediction together.
- Group work, 20 minutes. In fours, one child is the robot, one lays the cards, one checks the plan, and one watches for bugs. Rotate roles after each go, so everyone writes a program.
- Debugging and review, 10 minutes. Set up a program with a deliberate bug, such as a missing turn. Ask the class to spot which card is wrong, and fix it with one change.
Following along on your device? Tap a step’s number to tick it off.
Teacher notes
The word algorithm sounds harder than it is. Present it as a recipe or a set of directions, with the steps in the right order. The word program is the same steps written so that a machine can follow them.
Left and right are tricky at this age, and harder still when the robot faces the class. Encourage the robot to hold up the hand for the way it is turning. Encourage the programmer to stand behind the robot and face the same way.
Celebrate bugs rather than treating them as failure. Finding and fixing a bug is exactly what programmers do, and the national curriculum asks pupils to "create and debug simple programs". When a robot goes wrong, ask "which card is the bug?" before anyone starts again.
Adapting the lesson
For pupils who need more support, use a 3 by 3 grid and only forward and one turn card. Let them place one card, run it, then add the next. Building the program one step at a time makes each instruction easier to see.
For pupils ready for more, add obstacles to the grid, or a "go forward 2" card to show a repeat. Ask them to predict the robot's final square and the way it faces before it moves. A second treasure, collected in order, makes the algorithm longer.
What to look for
Assessment here is mostly by watching and asking. A pupil working at the expected level can lay out cards in an order that reaches the treasure. They can say where the robot will end before it moves. They can point to the card that caused a bug and say what to change.
Ask each group to explain their algorithm aloud. A pupil who uses the words "algorithm", "instruction" and "bug" correctly has understood the core idea of the lesson.
Check your understanding
Have a go first, then open each answer to check.
1.What is an algorithm?
Show the answer
A set of steps, in the right order, to do a job. Pupils might say "a list of instructions".
2.Why must the cards be in the right order?
Show the answer
The robot follows the cards one after another, exactly. If the order changes, the robot ends somewhere else.
3.The robot turned but stayed on its square. Is that a bug?
Show the answer
No. A turn happens on the spot, so the robot should face a new way without moving. That is what the card says.
4.The robot walked past the treasure. How could you fix the program?
Show the answer
Find the card where it went wrong, often one forward card too many, and remove or change that one card. Then run it again.
Key words
- Algorithm
- A list of steps, in the right order, to do a job.
- Instruction
- One step that tells someone exactly what to do.
- Program
- An algorithm written so that a computer, or a robot, can follow it.
- Bug
- A mistake in a program that makes it go wrong.
- Debug
- To find a bug and fix it.
Sources
The curriculum statements and specification points on this page come from these documents, read on 2 December 2026. Specifications are updated from time to time, so check your exam board's current version.
Spotted something wrong or out of date? Tell us and we will correct it.