Given the starting point in a maze, you are to find and mark a path out of the maze which is represented by a 20 by 20 array of 1s (representing hedges) and 0s (representing the foot-paths). There is only one exit from the maze (represented by E). You may move vertically or horizontally in any direction that contains a 0; you may not move into a square with a 1. If you move into the square with an E, you have exited the maze. If you are in a square with 1s on three sides, you must go back the way you and try another path. You may not move diagonally. For this program, USE A SINGLE LINKED LIST ONLY.
Program Requirements:
Following are the requirements for this program:
Your program should use single linked list.
Input of program: input is a 20 by 20 array of characters (1s , 0s, and E) from an ASCII text data file (maze.txt); for example:
Each data line consists of one row of maze. Starting points (i.e a row, column pair) in the maze will be input from the keyboard.
Output of program:
Echo print the maze complete with numbered rows and columns prior to asking the user for their starting point. For each entry into the maze, print the complete maze with an S in the starting point followed by the words I am free if you have found a path out of the maze or the words Help, I am trapped if you cannot. Your output could be in two formats
Print the path (by using a series of pluses (+)) you took through the maze should one be found, Or print the path as a single linked list
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference
and should not be submitted as is. We are not held liable for any misuse of the solutions.
Please see the frequently asked questions page
for further questions and inquiries.
Kindly complete the form.
Please provide a valid email address and we will get back to you within 24 hours.
Payment is through PayPal, Buy me a Coffee
or Cryptocurrency.
We are a nonprofit organization however we need funds to keep this organization operating
and to be able to complete our research and development projects.