-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (23 loc) · 661 Bytes
/
main.py
File metadata and controls
30 lines (23 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from graphics import Window
from maze import Maze
import sys
def main():
num_rows = 12
num_cols = 16
margin = 50
screen_x = 800
screen_y = 600
cell_size_x = (screen_x - 2 * margin) / num_cols
cell_size_y = (screen_y - 2 * margin) / num_rows
sys.setrecursionlimit(10000)
win = Window(screen_x, screen_y)
maze = Maze(margin, margin, num_rows, num_cols, cell_size_x, cell_size_y, win, 50)
print("maze created")
is_solveable = maze.solve()
if not is_solveable:
print("maze can not be solved!")
else:
print("maze solved!")
win.wait_for_close()
if __name__=="__main__":
main()