-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
102 lines (99 loc) · 5.38 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
96
97
98
99
100
101
102
**README**
-----------
*3D Maze Solver + 3D Maze Solver GUI!*
**Overview:**\
In this project, we focused on creating two ways to solve a three-dimensional character array!
One way was using a hardcoded "simple solve." This method simply takes input instructions of row,
col, and level of starting point and utilizes a hardcoded step path to solve the maze!
The second method used is the focus of the project, a randomized step path! This path constantly changes
the direction in which its taking. On top of this, the goal was to create the most efficient path forward.
Based on this we created a system in which the user can specify the amount of trials to run. The random solver
will then solve the maze x amount of times and log the steps it took to achieve the exit. This is processed and
then the map that solved the maze with the least amount of steps is produced along with the max step count taken
of the mazes!On top of this, the program also includes a GUI interface that can be run completely separately
from the program itself (meaning no console commands!).The aim in including this is to expand the user
base potential of the program by taking the complications of hardcoding instructions out and allowing the
user to simply run the program. The GUI utilizes the Random Best Solve methodology but takes the same inputs
that the main method does as well! The implementation of this program uses a variety of structures: primarily multi-dimensional
arrays and also various Lists throughout the program! _Read the following portions carefully in order to use the program correctly!_
**Instructions:**\
This program can be run in a variety of ways!
\
\
_Creating a Map:_\
The map uses a variety of characters to make the maze more complicated! To make your own map, decide how many layers,
rows, and columns you'd like to have! The maze must be even (meaning every floor must have the same rows and cols
and all rows must be the same length!) Create an input text file, place in parent folder to the actual code!
The format of the file should be exactly as follows:
\
\
_{Number of Levels}_ _{Number of Rows per Level}_ _{Number of Columns per Level}_\
_{Starting Level}_ _{Starting Row}_ _{Starting Column}_\
_(level 1 maze characters)_\
"--------------------------" <-------here you enter a series of dashes (doesnt matter how many and no quotations, thats just here in readme), to signify end of the floor \
_(level 2 maze characters)_\
"--------------------------"\
_(level 3 maze characters)_\
"--------------------------"\
etc. etc. etc.\
\
\
The characters to used to complete the mazes are as follows:
\
Wall -> * (cannot spawn in a wall or move through a wall)\
Path -> . (these are the spaces you can move! you can spawn here and move around here)\
Trampoline -> # (these spaces allow you to move up a floor! beware, there must be a valid path tile above, or you can't go there!)\
Trapdoor -> ! (these spaces allow you to fall down a level! same as a trampoline, you must have a valid path below it or what's the point!)\
\
\
Two Sample Mazes are included in the OG file! A medium maze and a small maze! You can build an endless diversity of mazes
but keep in mind that its processing thousands of moves a second with the random solver so more complexity = more time/more work for computer!
The PC this was tested on could run 10,000 different versions of the Medium maze in about 2 seconds, so it is relatively fast, but it depends on your computer processing speed!
\
\
**Using the GUI:**\
The GUI is meant to be easier to run than going from the program! This GUI utilizes the same methodolgy of the Random Best Solve!
To run this, simply run the 3DMazeSolver.jar.
Paste a maze (omitting the dashes) that looks like the maze below:
`**********`\
` *.******..`\
`*......***`\
`****.*..**`\
`**...*...*`\
` *#.*******`\
`**********`\
`----------`\
` **********`\
`*#***#**!*`\
`*.***.****`\
`*...*...**`\
` *.*****.**`\
`*........*`\
`**********`\
` **********`\
` *.***.**!*`\
`*.***....*`\
` *.********`\
`*.......**`\
`*......!**`\
`**********`\
\
Then enter the same numbers you would at the top of the maze text file and click run! The GUI view of the maze can be distorted due to
how the text box displays character spaces. If you want a better view of the Maze, solved or unsolved,
paste it into a text file open in IntelliJ to see it evenly spaced!
\
\
**Disclaimers:**\
The maze must be built out of these and in the exact layout as above! If you using the GUI, you do not need to
include the series of dashes to signify floor breaks! Just stack the levels on top of each other! Another thing to keep in mind is
that the maze starting position uses Array logic (meaning if you wanna start at 1, 2, 2, you would put in 0, 1, 1).
The maze dimensions are just as normal (if you wanna build a 3 x 7 x 10 maze, you enter 3 7 10)\
\
Also the maze **MUST BE SOLVABLE** aka there must be an exit! This is more complex than just a normal maze solver,
the goal here is to find the best way out *when there is a way out*! This is due to the recursive nature of the program
and therefore if it cannot find an exit, it cannot stop! It will literally keep going forever! That's not very
nice to your computer or the maze :( so if your not getting any output, but the program is still running, make
sure that the maze is set up correctly.
\
\
Google Slides Link: https://docs.google.com/presentation/d/1VM4q3PGB7Oc7kb_9-TmZbg4dyIu0Tq8-kXLslvMrbi8/edit