Question: Maze solver 1 ) . Use a Depth First Search to solve a maze to be represented as graphic instead of text file. The first
Maze solver
Use a Depth First Search to solve a maze to be represented as graphic instead of text file.
The first line contains the integer value which indicates that this maze has rows and columns.
G
#########
#########
######
########
#######
#########
#########
S#######
#########
Write two java classes MazeSolve and MazeTest
The MazeSolver should have the following properties:
public void solveMaze
solveMazestartX startY;
A private method called solveMaze with a signature public boolean solveMazeint x int y that implements algorithms called find path.
Member variable n indicating the size of the n x n member variable called maze. maze stores the values of the maze and the current path.
Member variables startX, startY, goalX, and goalY indicating the starting and goal positions in the maze.
Method readMaze to read a maze.
Method displayMaze to display a maze in graphic.
Method solveMaze that finds the path between the start and goal positions.
Modify the below code as appropriate in order to meet the above requirements
public void readMaze
try
FileReader fr new FileReader filename ;
BufferedReader br new BufferedReader fr;
nIntegerparseInt br readLine ;
maze new char nn ;
for int i;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
