#include <stdio.h>
#include <stdlib.h>
#define random(num)(rand()%(num));
#define MAX_STACK_SIZE 100
int maze[11][15]=
{
0,1,0,0,0,1,1,0,0,0,1,1,1,1,1,
1,0,0,0,1,1,0,1,1,1,0,0,1,1,1,
0,1,1,0,0,0,0,1,1,1,1,0,0,1,1,
1,1,0,1,1,1,1,0,1,1,0,1,1,0,0,
1,1,0,1,0,0,1,0,1,1,1,1,1,1,1,
0,0,1,1,0,1,1,1,0,1,0,0,1,0,1,
0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,
0,0,1,1,0,1,1,0,1,1,1,1,1,0,1,
1,1,0,0,0,1,1,0,1,1,0,0,0,0,0,
0,0,1,1,1,1,1,0,0,0,1,1,1,1,0,
0,1,0,0,1,1,1,1,1,0,1,1,1,1,0
};
typedef struct{
int y, x;
}element;
element stack[MAX_STACK_SIZE];
int top=-1;
void add(int *top, element item){
if(*top>=MAX_STACK_SIZE - 1){
fprintf(stderr,"tttstack is full.n");
return;
}
stack[++*top]=item;
}
element del(int *top){
if(*top==-1){
printf("tttstack is empty.n");
return stack[MAX_STACK_SIZE];
}
return stack[(*top)--];
}
.
.
.
.
.
.
.
.
.