Answered You can hire a professional tutor to get the answer.
Write a C++ function named pathExists that determines whether or not a there's a path from start to finish in a rectangular maze. Here is the...
bool pathExists(string maze[], int nRows, int nCols, int sr, int sc, int er, int ec)
{
// Return true if there is a path from (sr,sc) to (er,ec)
// through the maze; return false otherwise
}
int main()
{
string maze[10] = {
"XXXXXXXXXX",
"X.......@X",
"XX@X@@[email protected]",
"X....XXX.X",
"X..XX.XX.X",
"X...X....X",
"XXXXXXXXXX"
};
if (pathExists(maze, 10, 10, 6, 4, 1, 1))
cout << "Solvable!" << endl;
else
cout << "Out of luck!" << endl;
return 0;
}
- Attachment 1
- Attachment 2
- Attachment 3