Path, Maze, Python, Shortest.
while not queue.empty(): current = queue.get() if current == end: return True # Shortest path found for direction in [(0, 1), (0, -1), (1, 0), (-1, 0)]: next_cell = (current[0] + direction[0], current[1] + direction[1]) if 0 <= next_cell[0] < maze.shape[0] and 0 <= next_cell[1] < maze.shape[1] and