-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
95 lines (77 loc) · 1.57 KB
/
README
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Maze Solving Program
Compiling
---------
Type `make` in the folder the source is in. This will create all the executables
for this program in the same folder.
Testing
-------
./maze-solve [-short] [-all] <filename>
Solves a maze file. With no options, the program will display the first
solution step by step. With -short, the program displays the shortest route to
the finish. With -all, the program displays all of the solutions to the maze,
one at a time.
./maze-gen [-h <height>] [-w <width>] <filename>
Generates a maze file. If either -h or -w are provided, the default height or
width is overrided, respectively. This exports in a format that can be loaded
by maze-solve and maze-show.
./maze-show <filename>
Prints the maze described by a maze file formatted to display on a terminal.
Example run:
$ cat maze
3 3
1 2
1 1
13 5 3
9 3 10
12 4 6
$ ./maze-solve maze
+---+---+---+
| |
+---+---+ +
| F | S |
+ + + +
| |
+---+---+---+
+---+---+---+
| O |
+---+---+ +
| F | S |
+ + + +
| |
+---+---+---+
+---+---+---+
| O O |
+---+---+ +
| F | S |
+ + + +
| |
+---+---+---+
+---+---+---+
| O O O |
+---+---+ +
| F | S |
+ + + +
| |
+---+---+---+
+---+---+---+
| X X X |
+---+---+ +
| F | S |
+ + + +
| O |
+---+---+---+
+---+---+---+
| X X X |
+---+---+ +
| F | S |
+ + + +
| O O |
+---+---+---+
Solution found!
+---+---+---+
| |
+---+---+ +
| F | S |
+ + + +
| O O |
+---+---+---+