Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class called Maze that includes a recursive call to find a path through a given text maze. The first 2 lines in the

Create a class called "Maze" that includes a recursive call to find a path through a given text maze. The first 2 lines in the text file represent the size of the maze and the the next 2 lines represent the starting location in the maze. A sample text file is attached.
I will test your program on a similar text file. maze.txt Click for more options
I would pick a separate character/letter to represent the path you are taking through the maze. Look for an E first, then if you can't find an E in the 4 spaces around you, look for an O, then if there is no O, you must be trapped so look for a P (if that is what you used) to backtrack.
1.) You will first have to set up tp read in the maze text file.
2.) You must dynamically create a 2-dimensional character array.
3.) Write a recursive method to "find your way" through the maze. (Each recursive call will represent one move in the maze)
**Think of the base case(s), then what would you look for next. This is not a long program, but a logic program.
***There is many solutions to this, but make sure what you submit is your own.
**** Remember to copy your code into a word document and submit that document for a grade.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions