Which sequence drives an L-shape — two segments, a right turn, then two more segments?
- A.turn_clockwise(); drive_intersections(2); drive_intersections(2)
- B.drive_intersections(2); turn_clockwise(); drive_intersections(2)
- C.drive_intersections(4)
- D.turn_clockwise(); turn_clockwise()
Answer Why?
After turn_clockwise(), what has to happen before the next drive_intersections()?
- A.A short drive forward to clear the cross
- B.Nothing — the turn ends with a sensor on the new line, and the next track_to_intersection() follows it from there
- C.A short time.sleep()
- D.A second turn to straighten up
Answer Why?
Starting at the bottom-left corner facing away from you, the robot runs: drive_intersections(3), turn_clockwise(), drive_intersections(2). Where does it end up?
- A.Back at the start
- B.3 intersections up from the start, then 2 intersections to the right from there
- C.2 up, then 3 to the right
- D.It never turns
Answer Why?