For this assignment, you will use a stack to solve mazes stored in text files as described in Mazes, Part 1. Though there are many maze-solving algorithms, we'll use a stack-based algorithm known variously as depth-first search, backtracking, etc.
Supplement your Maze.java (and your MazeSquare.java if you have one) from Mazes, Part 1 to support solving mazes and printing the solved version. Specifically:
Your Maze class should include a method with the following signature:
Your program's command line should follow the syntax:
For example, suppose maze.txt contains:
then "java Maze maze.txt" should print the maze with no solution, like so:
while "java Maze maze.txt --showsolution" should print the maze with the path of the solution marked, like so:
Start early, ask questions, and have fun!