Skip to main content
Module 4 · Manhattan Navigation

Lesson 4-3 · The Planner: Every Direction — Knowledge Checks

Name Date
  1. Does (1, 3) == (3, 1) evaluate to True?

    1. A.Yes: they contain the same numbers
    2. B.No: the parts must match in order, and these are swapped
    3. C.Yes: tuples ignore order
    4. D.It causes an error

    Answer Why?

  2. For a trip that goes up and to the right, how many of the four while loops actually run?

    1. A.All four
    2. B.Two: the east loop and the north loop
    3. C.Just one
    4. D.None: it needs if/else

    Answer Why?

  3. A classmate gets [(3, 3), (2, 3), (1, 2), (1, 1), (1, 0)] for (3, 3) to (1, 0). What went wrong?

    1. A.Nothing: that is a valid Manhattan path
    2. B.The west loop appends before it subtracts 1 from x, so the start is included and (1, 3) is skipped: promise 1 is broken
    3. C.The destination tuple is backwards
    4. D.The south loop ran before the west loop

    Answer Why?

  4. What does separation of concerns let you do here?

    1. A.Run the robot faster
    2. B.Test the path planning on its own, separately from the driving
    3. C.Skip testing entirely
    4. D.Combine planning and driving into one function

    Answer Why?