Bolt must pass through five maze checkpoints.
Most checkpoints are clear, but checkpoint
2 contains a wall.
Combine a for loop with an
if/else decision so Bolt knows when
to move and when to turn.
Your program will process each checkpoint in order.
Use a loop to process all five maze steps.
Inside the loop, check whether
step == 2.
At checkpoint 2, Bolt should
turn_right().
At every other checkpoint, he should
move().
for step in range(5)
step == 2
If the wall were moved from checkpoint 2 to checkpoint 4, how should the condition change?
You combined repetition and selection:
a loop handled each checkpoint while an
if/else statement chose the
correct action.