Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A skeleton code is provided at: https://www.cs.uic.edu/pub/CS211/ProjectS18/maze.c As well as sample input files: https://www.cs.uic.edu/pub/CS211/ProjectS18/mazeData1.txt (simple 10x20 maze) https://www.cs.uic.edu/pub/CS211/ProjectS18/mazeData2.txt (simple 20x20 maze) https://www.cs.uic.edu/pub/CS211/ProjectS18/mazeData3.txt (a maze with
A skeleton code is provided at: https://www.cs.uic.edu/pub/CS211/ProjectS18/maze.c As well as sample input files: https://www.cs.uic.edu/pub/CS211/ProjectS18/mazeData1.txt (simple 10x20 maze) https://www.cs.uic.edu/pub/CS211/ProjectS18/mazeData2.txt (simple 20x20 maze) https://www.cs.uic.edu/pub/CS211/ProjectS18/mazeData3.txt (a maze with errors in the input) https://www.cs.uic.edu/pub/CS211/ProjectS18/mazeData4.txt (a maze with no solution)
Maze Solving For this project, write a C program that will find its way through a maze using the depth-first search algorithm. This program takes input from a file where the filename is specified in the command line arguments. The input file will only contain two integer values per line of input: The first valid line gives the size of the 2-D maze (the number of rows given by the first number, then the number of columns given by the second number), valid values are > 1 The second valid line gives the coordinates of the starting position in the maze The third valid line gives the coordinates of the ending position in the maze The remaining valid lines in the file give the coordinates of blocked positions in the maze . . . . If the command line arguments do not contain a valid filename, you should print an error message to STANDARD ERROR and quit the program. This could be because there was not a name given or the name given did not match that of a valid file. If the command line arguments contains multiple names, we leave it up to you to come up with a "good solution". Ideas on such a "good solution" could be Use one of the names as the input file and proceed (pick which name makes most sense to use Give an error message stating that too many names were given and quit. Run the program to solve the maze given with each filename . . The following shows an example of such an input file. The coordinates are given with the row listed first and the column listed second. A maze of NxM has rows numbered from 1 to N and columns number from 1 to M 10 20 10 20 4 2 1 10 3 8 8 3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started