MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / find_neighbour

Function find_neighbour

projects/BFS visualizer/main.py:84–96  ·  view source on GitHub ↗
(maze_1, row, col)

Source from the content-addressed store, hash-verified

82
83
84def 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

Callers 1

find_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected