No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
1 Posted Topic
#include<conio.h> #include<stdio.h> #define SIZE 15 #include<stdlib.h> void main() { int maze[SIZE][SIZE],mark[SIZE][SIZE],stack[SIZE][3]; static int move[8][2]={-1,0,-1,1,0,1,1,1,1,0,1,-1,0,-1,-1,-1}; int i,j,m,n,top,mov,g,h; clrscr(); printf("enter size"); scanf("%d%d",&m,&n); for(i=1;i<=m;i++) { for(j=1;j<=n;j++) { scanf("%d",&maze[i][j]); } } for(i=0;i<=n+1;i++) maze[0][i]=1; for(i=0;i<=n+1;i++) maze[m+1][i]=1; for(i=0;i<=m+1;i++) maze[i][0]=1; for(i=0;i<=m+1;i++) maze[i][n+1]=1; for(i=1;i<=m;i++) { for(j=1;j<=n;j++) { mark[i][j]=0; } } mark[1][1]=1; stack[0][0]=1; stack[0][1]=1; stack[0][2]=2; top=1; while(top!=0) { i=stack[0][0]; …
The End.
aakash juneja