Im working on a maze solving program and i'm a little lost. It should just follow the maze walls to the right and find the exit using: west=0, north=1,east=2,south=3.
The '.' represent open spaces in the maze, and the '#' represent walls.
I have the maze and i have it printing but i am not sure how to do a solving function. I have searched but everything i found just confuses me and i cant figure out how to implement it in my program . Please help
code
Code:#include <stdio.h>
#include <string.h>
void display( char maze[12][12],int row, int column )
{
int i,j;
for( i = 0; i<12; i++)
{
for( j = 0; j<12; j++)
{
printf( "%c", maze[i][j]);
}
printf("\n");
}
int main()
{
int row = 2;
int column = 0;
int direction;
char maze[12][12] = {'#','#','#','#','#','#','#','#','#','#','#','#',
'#','.','.','.','#','.','.','.','.','.','.','#',
'x','.','#','.','#','.','#','#','#','#','.','#',
'#','#','#','.','#','.','.','.','.','#','.','#',
'#','.','.','.','.','#','#','#','.','#','.','.',
'#','#','#','#','.','#','.','#','.','#','.','#',
'#','.','.','#','.','#','.','#','.','#','.','#',
'#','#','.','#','.','#','.','#','.','#','.','#',
'#','.','.','.','.','.','.','.','.','#','.','#',
'#','#','#','#','#','#','.','#','#','#','.','#',
'#','.','.','.','.','.','.','#','.','.','.','#',
'#','#','#','#','#','#','#','#','#','#','#','#',};
return 0;
}