This program explores a maze, finding a path from an entry point to an exit one.
#
representing walls and ␣
(empty space) representing passages.examples
directory.
F
means 'move forward' according to your current directionR
means 'turn right' (does not move, just change direction), and L
means ‘turn left’. F
, R
and L
symbolsFFF
= 3F
, LL
= 2L
).FFLFF
= FF L FF
)To build the program, simply package it with Maven:
ethanmcmehen@Ethan-MacBook-Air Maze-Runner % mvn -q clean package
The program uses the following flags to run correctly:
-i MAZE_FILE
: specifies the filename to be used;-p PATH_SEQUENCE
: activates the path verification mode to validate that PATH_SEQUENCE is correct for the mazeWhen no logs are activated, the programs only print the computed path on the standard output.
ethanmcmehen@Ethan-MacBook-Air Maze-Runner % java -jar target/mazerunner.jar -i ./examples/straight.maz.txt
4F
ethanmcmehen@Ethan-MacBook-Air Maze-Runner %
If a given path is correct, the program prints the message correct path
on the standard output.
ethanmcmehen@Ethan-MacBook-Air Maze-Runner % java -jar target/mazerunner.jar -i ./examples/straight.maz.txt -p 4F
Correct Path
ethanmcmehen@Ethan-MacBook-Air Maze-Runner %
If a given path is incorrect, the program prints the message incorrect path
on the standard output.
ethanmcmehen@Ethan-MacBook-Air Maze-Runner % java -jar target/mazerunner.jar -i ./examples/straight.maz.txt -p 3F
Inccorrect Path
ethanmcmehen@Ethan-MacBook-Air Maze-Runner %