Under no circumstances will late assignments be accepted.
The code you submit must conform with the programming guidelines.
In this assignment you will use recursion to find a path through a maze.
' '(blank) represents empty space
'*' represents a wall (a cell your solution cannot occupy)
'?' represents a cell that was considered and rejected
by your algorithm
'@' represents a cell on the solution path
'S' represents the starting position in the maze
'E' represents the ending position in the maze
When you read the maze data, each cell will contain either a blank or a '*'. Here is an example maze. As you solve the maze, update blank cells to one of the other symbols ('?','@'). Here is an example solution to the example maze.
For this assignment, assume that all mazes have 20 columns and 18 rows. Your program should read a maze file through standard input. You should print the resulting solution to standard output in the same format as shown in the example solution. If there is no solution to the maze, then print an error message to "cerr".
Hint: Use object-oriented programming. For instance, you could define a maze class:
const int MAZE_ROWS = 18;
const int MAZE_COLS = 20;
class Maze
{
public:
Maze();
// default constructor
bool read();
// reads a maze from standard input
bool solve(int r, int c); // recursive
solver, that starts at position (r,c) and tries to find 'E' in maze
void print() const;
// prints a maze to standard output
private:
int rows,cols;
int start_row,start_col;
char maze[MAZE_ROWS][MAZE_COLS];
};