Why must a planner be TOLD the robot's position instead of remembering it?
- A.So the planner and the driving code can never disagree about where the robot is
- B.Because functions cannot store values between calls
- C.To make the path shorter
- D.Because the position changes while the path is being computed
Answer Why?
Why does add_blocked() not need `global BLOCKED`, when set_threshold() in Lesson 2-7 needed `global THRESHOLD`?
- A.append changes the list in place; set_threshold reassigns the name
- B.Lists are always global
- C.BLOCKED is in capital letters
- D.It does need it — the code above is wrong
Answer Why?
(1,1) is blocked. Someone wrote build_graph with the first `in blocked` check but forgot the second. What is wrong with the result?
- A.(1,1) is not a key, but it still appears in its neighbors’ lists — there are edges into the wall
- B.(1,1) is a key with an empty neighbor list
- C.Nothing — the first check is enough
- D.The graph has 16 keys instead of 15
Answer Why?