Question
Create a program that loads a maze file and prints 1.the maze and 2.the maze with the shortest solution. The maze will be taken from
Create a program that loads a maze file and prints 1.the maze and 2.the maze with the shortest solution. The maze will be taken from a file maze.txt which will look something like this:
maze.txt
XXXXXXXXXXXXXXXXXXXXXXXXXXXX XS XXX X X X X XXXXXXXXXXXXXX X X XXX X X FX XXXXXXXXXXXXXXXXXXXXXXXXXXXX
The program should load the maze.txt into a graphical representaion of a maze then find the shortest path by first checking up, down, left, then right. If there is a solution, the program will output the maze with the path filled with a dot (.). If there is no solution, simply output No solution. Program should print out the initial maze first.
It is important to note that the program must be executable in the terminal by typing:
javac Maze.java
java Maze mazeFile
maze - Notepad File Edit Format View Help XS XXX FX 11/25/2017Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started