1) This program has two reference files called:
2) Add a README.TXT file(to briefly describe how you made it work like conditions,compiling and running instructions (I need to understand how to run what you programed for me)
3) Write a complete "C-program that reads mazes from a text file and for each one, determines whether a solution works or not" The mazes are represented in the text file by an integer indicating the number of rows in the maze, followed by a 2D block of that many rows and some number of columns, with # representing maze walls and spaces representing paths in the maze;
e.g.
12
##########
# #
####### ##
# #
# ###### #
# # #
# # # ###
####
# # #####
# ## #
# # # #
##########
This can be followed by a blank line and another maze, until the end of file.
The entrance(s) to the maze are open spaces in the leftmost column, while the exit(s) to the maze are open spaces in the rightmost column. A path is a route through the spaces that moves in any of the four cardinal directions (north, south, east, west) (this is known as a 4-connected path and does not allow diagonals). A maze is solvable if there exists a path from any entrance to any exit.
The algorithm for determining solvability that we will use is non-recursive and requires that you maintain both the maze and a list of spaces (locations) in the maze. It looks like this:
Start at an entrance.
Mark the current location on the maze: it is no longer a space.
Check the current location. If it is an exit, a solution has been found and the algorithm ends. Otherwise, check the locations around the current:
If the location to the north is a space, add it to the list.
If the location to the south is a space, add it to the list.
If the location to the east is a space, add it to the list.
If the location to the west is a space, add it to the list.
If the list is empty, the algorithm has failed to find a solution. Otherwise, remove a location from the list, make it the current location, and go back to step 2.
Actually, the "list" is a queue and can be implemented as such.
Repeat the algorithm for every entrance until you find a solution or run out of entrances. As output, show the following for each maze:
Print the original (unsolved) maze. Print a message that clearly indicates whether or not there was a solution. If the maze is solvable, print the maze with the solution marked with a symbol other than space or #. Note that this is not necessarily an optimal solution. However, only show markings for the successful entrance; do not show markings for entrances that failed to find a path. For example, the maze above may generate output similar to the following:
Maze is solvable:
##########
#**#
#######*##
#********#
#*######*#
#*#******#
#*#**#*###
**####****
# # #####
# ## #
# # # #
##########
where the upper entrance (which leads to a dead end) does not show a marked path. Your solution may look different, depending on how you process the list.
note: There are no errors in the input file format.
your solution:
The name of the input file is specified as a command-line argument. Use error checking to make sure that exactly one argument is given. Print the results to standard output.(very important) Assume a maximum maze dimension of 100x100. Please create your own data to test other situations! and i could have like one or two
please Use the following (reference)input files:(attached) sample.txt a2q1.txt