Lines 10-16: Your
if
statements need work.
if
is not capitalized. Your conditions are pseudo-code, not C++ statements.
return
should not be capitalized.
Line 10: What is this supposed to be testing?
Line 12: Comparing two different character literals will never be true.
Line 36-37: move to after line 6 so these consts are available to the entire program.
line 14: Outside the maze is easy if you know the size of the maze.
14 15 16 17
|
// Note the change from rows,cols to row,col
if (row < 0 || row >= ROWS || col < 0 || col >= COLS)
return false;
|
Line 16: It's a little hard to check for a breadcrumb if you don't have access to the maze. You need to pass maze as an argument to mazeEscape.
7 8 9
|
bool mazeEscape(char maze[ROWS][COLS], row, col)
// changed rows,cols to singular
// See below
|
16 17
|
if (maze(row][col] == breadcrumb)
return true;
|
Lines 20,23,26,28: You use row,col here, but your argument names are rows,cols.
Line 47: If you can't open the file, you fall through to line 58 as if nothing had happened. You should report that you can't open the file and exit the program (or prompt for the filename again).
Lines 58-65: You probably want to put displaying the maze in a separate function.
I don't see where you ever call mazeEscape from main().