-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
48 lines (34 loc) · 893 Bytes
/
main.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from maze import Maze, Coord, generate_empty_square_maze
from graphics import Board
from generation import GeneratedMaze
def test_search():
spaces = generate_empty_square_maze(100)
start = Coord(1, 1)
end = Coord(0, 0)
maze = Maze(spaces, start, end)
gen = GeneratedMaze(9)
gen.dfs()
def test_graphics():
spaces = [
[1, 0, 1, 0, 1, 1],
[0, 0, 0, 0, 1, 0],
[1, 0, 1, 0, 1, 0],
[0, 0, 1, 0, 0, 0],
[0, 1, 0, 0, 1, 0],
[0, 0, 0, 1, 0, 0]
]
start = Coord(1, 1)
end = Coord(4, 5)
maze = Maze(spaces, start, end)
maze.randomize(20, .3)
board = Board(maze)
board.show_callback(maze.bfs, None)
def test_generation():
gen = GeneratedMaze()
gen.generate()
board = Board(gen)
board.root.mainloop()
def main():
test_generation()
if __name__ == '__main__':
main()