maze-solver/main.py
Dan Anglin a091f0a68d
refactor: add a dedicated class for the solver
Create a separate class to represent the solver of the maze.
Additional search algorithms will be implemented here.

Additional changes:

- Add public methods to mark cells as visited and to get results of
  the visits.
- Renamed MazeDirections to MazeDirection.
- Renamed _num_cell_rows to _height.
- Renamed _num_cells_per_row to _width.
- Created a dedicated method to configure a cell's walls in the Maze
  class.
- created a dedicated public method to draw a path between two cells in
  the Maze class.
2024-02-16 23:27:09 +00:00

30 lines
514 B
Python

from graphics import Window
from maze import Maze
from solver import Solver
def main():
window = Window(800, 800)
game = Maze(
x_position=10,
y_position=10,
height=16,
width=16,
cell_height=40,
cell_width=40,
window=window
)
solver = Solver(game)
if solver.solve():
print("Maze solved successfully :)")
else:
print("I'm unable to solve the maze :(")
window.mainloop()
if __name__ == "__main__":
main()