TroveToolsAll tools

Program the Robot

Computing · Year 1–Year 4

Write the programme, press Go, and fix the step that went wrong.

About the program the robot

A robot on a grid and a flag to get it to. Tap Forward, Turn left and Turn right to write a programme down the side of the board, then press Go and the whole thing runs, one command at a time.

THE WHOLE PROGRAMME COMES FIRST, and that is the difference between this and moving a counter about with the arrow keys. Nothing on the grid moves until Go, so the class has to say where they think it will end up before they find out. That gap between the plan and what happens is what an algorithm is.

When it goes wrong, it goes wrong visibly and harmlessly: the robot bumps into a wall or a block and stops, and the board says which step it stopped on. Tap that card in the programme, tap a different command, and it is fixed. Running it again to see is the whole of debugging.

EVERY PRESS OF NEW IS A DIFFERENT PUZZLE: a fresh start square, a fresh direction to be facing, a fresh flag and fresh blocks in the way. The flag is never on the robot's own row or column, so every board needs at least one turn in it, and nothing is ever in the way of the start or the flag.

Nothing is scored and nothing is timed. Reaching the flag is the outcome, the way the till drawer shutting is: there are no stars for getting there in fewer steps.

There is no Repeat command. A repeat needs a count and a scope, which is a second control and a nested list, and this tool is about getting a sequence right first.

How to use it on your whiteboard

  1. 1Tap a command to add it to the programme on the right.
  2. 2Ask the class where the robot will end up, then press Go.
  3. 3Watch it run: each card lights up as the robot does it.
  4. 4If it went wrong, tap the card that was wrong and tap a different command to change it.
  5. 5Tap Take out to remove the card you have picked, or Clear to start the programme again.
  6. 6Press Start again to put the robot back, then Go to run it once more.
  7. 7Press New under Board for a different start, flag and blocks, and 8 × 6 for a bigger grid.

Questions

How is this different from the direction grid?
On the direction grid a press moves the counter one square and the board writes down the route as you walk it. Here nothing moves until the whole programme has been written and Go is pressed. One is following directions, the other is writing an algorithm and finding out whether it worked.
What happens if the programme is wrong?
The robot does exactly what it was told, bumps into whatever is in the way and stops. The board says which step it stopped on. Nothing is marked wrong, because the point is to find the step that needs changing and run it again.
Can I change one command in the middle?
Yes. Tap that card in the programme to pick it, then tap a command to change it to that one. Tap Take out to remove it. Fixing one step is the thing a class needs to be able to do, so it does not take clearing the whole programme.
Why is there no Repeat?
Repeat needs a number and a scope, which turns a list a Year 1 can read top to bottom into a nested one. Getting a sequence right and finding the step that is wrong is the objective here.