From 7d14639b09178ce9360468cf77e5b3ce3ea1f6c6 Mon Sep 17 00:00:00 2001 From: poorb20 <56602749+poorb20@users.noreply.github.com> Date: Wed, 30 Oct 2019 11:21:49 +0530 Subject: [PATCH] Create maze.cpp --- maze.cpp | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 maze.cpp diff --git a/maze.cpp b/maze.cpp new file mode 100644 index 0000000..99b4a8a --- /dev/null +++ b/maze.cpp @@ -0,0 +1,287 @@ +#include +#include +using namespace std; +// i j x y m n +int m=0,n=0,w; +int stack[100]; +//int mazeSol[100][100]; +int top=-1; +//stackfunctions + +void push(int); +void pop(); +void display(); +bool isEmpty(); +//mazefunctions + +void createMaze(int,int); +void checkMaze(int[][100],int,int,int); +bool isSafe(int,int); + +//stackfunctions +void push(int item) +{ + top++; + stack[top]=item; +} +void pop() +{ + if(isEmpty()) + { + cout<<"STACK EMPTY\n"; + } + else + { + w=stack[top]; + top--; + //cout<<"\n"; + //cout<=0&&x2=0&&y2>c; + createMaze(c,5); + cout<<"ENTER MAZE IN 0 AND 1 FORM. 1 REPRESENTS BLOCKED PATH AND 0 REPRESENTS OPEN PATH\n"; + int maze[c][5]; + for(int i=0;i>maze[i][j]; + } + } + maze[0][0]=-1; + checkMaze(maze,0,0,0); + return 0; +}