Mission 7  ·  Hints

The Grand Maze

Open one hint at a time. Try it before you open the next.

Hint 1 — Think about it
Two solved problems, one program. The trick is the switch: at the doorway there is no wall ahead any more, so the car keeps driving until the color sensor sees the black tape. Run your Hug the Wall loop until black, then your Follow the Line loop until green.
Hint 2 — Which blocks to use
repeat until < color sensor sees black >Phase 1: your Mission 5 loop, new ending condition.
repeat until < color sensor sees green >Phase 2: your Mission 6 loop.
color sensor F sees ( black )The doorway marker.
celebrateSound + light on the tile.
Hint 3 — Plan in plain words
  1. Copy the Mission 5 loop and change “green” to “black”.
  2. After it, add the Mission 6 line-following loop.
  3. End with celebrate.
  4. Test each phase alone before joining them.

Watch out: If it works in pieces but fails when joined, look at where phase 1 ends: is the car straight and on the tape start before the line-following loop begins?

Playbook: The right-hand rule · Dead ends: everything blocked · Follow the line · Green means go · Explore, then sprint

← Challenge

Printable version: mission-7-hints.pdf