Lesson 10 · 60 minutes
The Maze Race
Everything at once, against the clock
Today's goal
Get your robot through a maze it has never seen, using a strategy you can explain.
Ideas in this lesson
- Dead reckoning: fast, but every error adds up
- Wall following: slower, but solves mazes you have not seen
- The right-hand rule always escapes a simple maze — and here is why
- Choosing a strategy is engineering: fast versus reliable
Sense → Think → Do
The full loop, under time pressure, with a maze nobody has calibrated for.
How the session runs
- Teams assemble their 2×2 room modules. Modules get rearranged between runs, so nobody can memorise the answer.
- Open the Maze Lab and try both strategies in simulation before touching a robot.
- Load a dead-reckoning program into Slot 1 and a wall-follower into Slot 2.
- Practice run. Note where each one fails and why.
- Race. Pick your slot at the start line by pressing 1 or 2 on the remote — no phone allowed on the floor.
- Debrief: whose strategy won, and would it win again on a different maze?
Sample program
The right-hand rule. Turn right, then check up to three times whether a wall is in the way and turn back left if so, then drive forward. Repeat. This escapes any maze whose walls are all connected — slowly, but it always gets out.
V 5 P 20 R 350 I 5 L 350 Z I 5 L 350 Z I 5 L 350 Z F 900 Q
Paste it into the Workshop's Robot language box, then press Text → blocks to see it as blocks — or just send it straight to the robot.
Try this
- Hybrid: blast down the first known straight, then switch to wall following. Where do you put the switch?
- Add a finish detector so the robot stops when it sees the exit line instead of driving on.
- Prove the right-hand rule cannot work on a maze with a free-standing island in the middle. Draw the counter-example.
When it goes wrong
| What you see | What it means |
|---|---|
| The dead-reckoning run drifts more each room | That is accumulated error. It is not fixable by trying harder — it is why sensors exist. |
| Wall follower loops forever in a circle | Check the maze actually has an exit reachable from the start. A sealed maze defeats a correct algorithm. |
Notes for the grown-up
Insist every team can state their strategy in one sentence before racing. The team that says 'we tuned the numbers until it worked' has learned less than the team that says 'we follow the right wall and accept it is slow', and the maze rearrangement will prove it in public.