Hello Teacher! Start the lesson by gathering your 7-8 year old pupils in a circle. Explain that an algorithm is like a recipe or a set of clear steps to do something, such as making a sandwich. Tell them that today, they will learn about algorithms by programming you, the teacher, as a robot to make a sandwich. Emphasise that robots follow instructions exactly as said, which can lead to funny mistakes if the steps aren't precise.
Prepare simple sandwich ingredients on a table: bread slices, butter, jam, a knife, and a plate. Explain to the pupils that you will act as the 'Robot Teacher' and only do exactly what they say, no more, no less. Invite the class to give you spoken instructions one by one to make the sandwich. Intentionally follow their words literally to expose bugs – for example, if they say 'put the butter on the bread' without specifying how, you might pretend to put the whole tub on the bread or on the floor. This will create humorous errors to highlight the need for precision.
After each attempt, pause and discuss with the pupils what went wrong – these are 'bugs' in the algorithm. Ask questions like: 'Why did the robot put the butter on the floor?' or 'What words could we use to make it clearer?' Have the class refine the instructions and try again, building a better set of steps together. Repeat until the sandwich is made correctly. This teaches debugging and the importance of clear, sequential steps.
Now, have each pupil draft their own algorithm for making a sandwich on paper. They should write or draw ultra-precise steps, like 'Pick up the knife with your right hand' or 'Spread the butter on one side of the bread slice.' Encourage them to think about order and details to avoid bugs.
Finish by having pupils pair up and test their algorithms aloud. One acts as the robot, following the other's instructions literally, while the other reads their steps. Switch roles, then discuss as a class what worked well and what needed fixing. Congratulate them on creating their first algorithms and explain how this relates to computers following precise instructions.