Lesson 4-3 · The Planner: Every Direction — Knowledge ChecksAnswer key
Does (1, 3) == (3, 1) evaluate to True?
(1, 3) is x = 1, y = 3; (3, 1) is x = 3, y = 1. Different intersections, so False.
For a trip that goes up and to the right, how many of the four while loops actually run?
At most one x loop (east OR west) and one y loop (north OR south) run for any trip. The other two find their condition False on the first check.
A classmate gets [(3, 3), (2, 3), (1, 2), (1, 1), (1, 0)] for (3, 3) to (1, 0). What went wrong?
Swapping the two lines inside a loop (append first, then change x) shifts that leg by one: the start appears and the corner is missed. The first element should never equal the start.
What does separation of concerns let you do here?
Because the planner only computes paths, you can check it on any computer before the robot is involved.