I am new in programming, and I am trying to implement Queue and back tracking. I made a program but I am lost trying to do the next description:
Use a queue to find paths through the maze (from Start to Goal) utilizing your maze program. Illustrate the progress through the maze at each step. Your program should visually distinguish between the path identified and any backtracking that may have occurred. In addition, illustrate the content of the queue at each step.
/*here is my work so far, if you can help me, it will be well appreciated;*/
#include "stdafx.h"
#include<stdio.h>
// Defining the graphic side of rickmaze
#define M 10
/* Putting a recursive function to solve maze problem*/
bool solveRickMazeUtil(int rickmaze[M][M], int x, int y, int solving[M][M]);
/* A function to print the matrix */
void printSolution(int solving[M][M])
{
for (int i = 0; i < M; i++)
{
for (int j = 0; j < M; j++)
printf(" %d ", solving[i][j]);
printf("\n");
}
}
/* check if x,y is valid index for M*M maze */
bool isSafe(int rickmaze[M][M], int x, int y)
{
/*returning false if x,y outside the rickmaze*/
if(x >= 0 && x < M && y >= 0 && y < M && rickmaze[x][y] == 1)
return true;
return false;
}
/* Using backtracking with this function rickmaze will be solved. When
the path is posible should return true and when it is not false */