2026-rff_mp/pogodinda/lab2/tests/test_maze.py

19 lines
596 B
Python

from src.maze import Maze, Cell
maze = Maze(5, 5)
# Заполняем границы стенами
for y in range(5):
for x in range(5):
if x == 0 or x == 4 or y == 0 or y == 4:
maze.set_cell(x, y, Cell(x, y, is_wall=True))
# Старт, выход, одна стена внутри
maze.set_cell(1, 1, Cell(1, 1, is_start=True))
maze.set_cell(3, 3, Cell(3, 3, is_exit=True))
maze.set_cell(2, 2, Cell(2, 2, is_wall=True))
print(maze)
print("Старт:", maze.start)
print("Выход:", maze.exit)
print("Соседи старта:", maze.get_neighbors(maze.start))