Imagine you ask a robot to walk to the door and you only say, Go over there. Will it know which way to face, how many steps to take, or when to stop?
Today we will write instructions so precise that even a robot that only does exactly what it is told can reach a goal.
Two words for today.
An algorithm is a clear, ordered list of steps. A bug is a mistake in those steps that makes the plan go wrong.
You will see a grid marked out on the floor, with one square as the start and the goal two squares ahead and one to the left. Follow that short journey with your eyes. What is the first small step you would write to get the robot moving along it?
Your group works at its own desk mat, with a robot token, a start and goal marker, one wall square and a set of command cards. The board holds the steps to follow.
The robot does exactly what the card says and nothing more. It cannot guess what you meant.
Share the jobs in your group: the writer lays the command cards in order; the reader calls one step at a time; the robot moves the desk token exactly as told, with no helpful guessing; the checker watches for the bug and says which step went wrong. If your group is smaller than four, combine jobs (for example writer and checker).
Change one thing at a time. If you rewrite the whole plan at once, you will not know which change made the difference.
On your Investigation Journal page, record what your group just tested on the desk mat.
Write your working command list in order (only forward, turn left, turn right). Then write: the step that went wrong, and what you changed.
Now we try the same idea on the screen at the front. The robot there still only understands forward, turn left and turn right, but the grid is not the one on your desk mat, so your group's sequence from earlier will not simply carry across.
Call out the order you want, and say what you expect to happen before we press run. If the robot stops short, name the one step you would change rather than starting the whole plan again.
You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.