In Java and using recursion and a 2d array. You need to make a maze solver. The
ID: 3689676 • Letter: I
Question
In Java and using recursion and a 2d array.
You need to make a maze solver. The program will take in from a file 2 things. The size of the square maze, and the maze itself. The maze will consists of numbers between 0 and 3, where 0 is the starting point of the maze, 1 is an open path, 3 is a wall and blocked , and 2 is the end. The maze will be no larger than 40x40. For example a 6x6 maze could be represented by the following file, there will be no spaces seperating the elements of the maze:
The program must then solve the maze. It will then output the correct path through the maze marked by 0’s to the command line. For example for the maze above could output the following.
000003
333301
110003
330333
330000
333330
You can assume that the input contains the exact amount of numbers needed and that it is a solvable maze, following the rules outlined above.
Explanation / Answer
Hi below i have written a sample method for maze solver using recursion for your reference,
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.