// MAZE PROGRAM - ASSIGNMENT 1 // PROGRAMMER : G.PAVAN KUMAR #include #include class stack { struct data //declared stack using struct inorder to make code effective { int x; int y; //x,y gives row-column details }q[100]; int top; public: stack() // declaration of constructor for initialization { top=0; } void push(int a, int b) { if(top > 100) // condition for stack limit cout<<"stackfull"; else { q[top].x=a; q[top].y=b; top++; } } void pop() { if(top >0) { top--; } else //verifying for empty stack poping cout<<"empty stack"; } void display(int m,int n,int **p)//displays path { int a,b; fstream outf; fstream out1f; outf.open("text9.txt",ios::app);//storing output out1f.open("stack1",ios::app);//stack output out1f<<"stack content"<0)&&(s0)&&(t>m; inf>>n; if(m>20 || n>20)//condition for exceeding limit cout<<"MAZE SIZE EXCEEDS LIMIT"<>l; eg.accept(l); } eg.travel(1,1); } if(inf.eof()!=0) cout<<"end of file"; }//end of main