2026-05-17 21:40:59 +00:00
|
|
|
import model
|
|
|
|
|
from builders import (TextFileMazeBuilder)
|
2026-05-18 10:39:13 +00:00
|
|
|
from strategies import (
|
|
|
|
|
BFSStrategy,
|
|
|
|
|
DFSStrategy,
|
|
|
|
|
AStarStrategy
|
|
|
|
|
)
|
2026-05-17 21:40:59 +00:00
|
|
|
|
|
|
|
|
builder = TextFileMazeBuilder()
|
|
|
|
|
maze = builder.buildFromFile("maze.txt")
|
2026-05-18 10:39:13 +00:00
|
|
|
strategy = DFSStrategy()
|
|
|
|
|
path = strategy.findPath(maze, maze.start, maze.exit)
|
|
|
|
|
print(f"Метод: {strategy}")
|
|
|
|
|
print("Путь:\n")
|
|
|
|
|
for cell in path:
|
|
|
|
|
print(f"({cell.x},{cell.y})")
|