(maze_1, row, col)
| 82 | |
| 83 | |
| 84 | def find_neighbour(maze_1, row, col): |
| 85 | neighbours = [] |
| 86 | |
| 87 | if row > 0: |
| 88 | neighbours.append((row - 1, col)) |
| 89 | if row < len(maze_1) - 1: |
| 90 | neighbours.append((row + 1, col)) |
| 91 | if col > 0: |
| 92 | neighbours.append((row, col - 1)) |
| 93 | if col < len(maze_1[0]) - 1: |
| 94 | neighbours.append((row, col + 1)) |
| 95 | |
| 96 | return neighbours |
| 97 | |
| 98 | |
| 99 | # to find the start location in maze |