forked from UNN/2026-rff_mp
12 lines
353 B
Python
12 lines
353 B
Python
from task2.mazeObjects.maze import Maze
|
|
from task2.mazeObjects.cell import Cell
|
|
|
|
def restorePath(parents: dict, start: Cell, exit: Cell) -> list[Cell]|None:
|
|
path = []
|
|
current = exit
|
|
while current:
|
|
path.append(current)
|
|
if current not in parents:
|
|
return None
|
|
current = parents[current]
|
|
return path[::-1] |