You are to prepare a C++ program that accepts one command line argument. This argument will be the name of a file containing a maze. For example, if the name of your compiled program is a.out and the name of the maze file is maze1 then you would run the program as follows.
./a.out maze1
The maze file is a text file made up of spaces for pathways, #’s for walls plus one ‘s’ and one ‘f’, representing the start and finish of the maze. For the maze to be well formed it must meet the following requirements
The following is an example of a well formed maze file.
#######
# #############
######## ### # ###
# #f### ######### #
#s#### # # # ### #
### # ####### ### ### #
# #### # ### ###
# ########### ###
#### #####
###############
The following points can also be noted about the mazes
The following are examples of U shaped mazes and are not considered well formed.
### ### ####### ###
#s# #f# # # #s#
# #### # or # ### ### #
# # #f# # #
######## ### #######
Such mazes create problems since it's more difficult to work out what's the inside and what's the outside of the maze.
Your program must do the following
Please see the Benchmark Program section below to learn exactly how the maze and metrics are to be displayed.
You can assume that all test cases given to your program will be well formed but you will need to check for the following problems:
When checking for invalid characters or f or s outside of the maze, you only have to check left, above and below the maze, not the right side. You will find this will make the assignment easier to code.
If you find a maze violation you will exit the program printing an error message stating you are unable to load the maze. Run the benchmark program below to see the exact format of the mess