Question: Problem 2: Maze Solver Write a program named MazeSolver.java to solve a maze. A maze can be represented with a string or a 2D array.
Problem 2: Maze Solver Write a program named MazeSolver.java to solve a maze. A maze can be represented with a string or a 2D array. For this assignment, we use 2D array. Original maze Solved Maze ------------- ----------- WWW WWW S.W S*W W.E W*E where W represents wall, S is for starting point, . for the available path, and E is Exit. The * in the solved maze is used to mark the path through it. There maze data files are provided. Some of them are no solutions. Your program should read these data files one by one, solve the maze and mark the path through it.
Maze1
8 8 WWWWWWWW W....W.W WW.WW..W W....W.W W.W.WW.E S.W.WW.W WW.....W WWWWWWWW
Maze 2
6 10 WWWSWWWWWW W....W.W.W WWWW.....W W...W.WW.W W.W....W.W WEWWWWWWWW
Maze3
3 4 ..WW W..S E.WW
Maze 4
3 4 ..WW W..S ..WE
MazenoE
8 8 WWWWWWWW W....W.W WW.WW..W W...W.WW W.W.W..W S.W.WW.W WWW....W WWWWWWWW
MazenoS
8 8 WWWWWWWW W....W.W WW.WW..E W...W.WW W.W.W..W #.W.WW.W WWW....W WWWWWWWW
MazeNoSolution
8 8 WWWWWWWW W....W.W WW.WW..E W..WW.WW W.W.W..W S.W.WW.W WWW....W WWWWWWWW
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
