SST <<
Previous Next >> Collect
Maze
解迷宮(探索與回溯)
用回溯法探索並回到起點。
# 範例 1:探索並回溯
def solve():
for i in range(4):
if not wall_in_front():
move()
solve()
turn_left()
turn_left()
move()
turn_left()
turn_left()
turn_left()
solve()
SST <<
Previous Next >> Collect