Hint 1 — Think about it
A tight U-turn and a dead end can look alike if you only measure depth. Look in every direction instead: at a U-turn one side is open. At a dead end all sides are blocked. That is the whole difference.
Hint 2 — Which blocks to use
| else (right blocked AND left blocked) | Reached only when nothing is open: a dead end. |
| turn around | Two turns in a row: a 180° arc. |
| set ( dead_ends ) to ( 0 ) / change ( dead_ends ) by ( 1 ) | A variable that counts. |
| write ( dead_ends ) on the light matrix | Show the count at the end. |
Hint 3 — Plan in plain words
- Copy your Mission 3 loop.
- Make a variable dead_ends = 0.
- In the last else branch: turn around, then add 1 to dead_ends.
- After the loop, write dead_ends on the hub.
Watch out: The car needs room to turn around: build the dead end at least one turning radius deep, and make sure the OPEN number is bigger than the distance to a side wall.
Playbook: Open or blocked? · Dead ends: everything blocked · The right-hand rule