Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool deadEnd(int x, int y, int** main_maze, int height, int width){
- int a = 0;
- if(x != 1){
- if(main_maze[y][x-2] == pass||
- main_maze[y][x-2] == room)
- a+=1;
- }
- else a+=1;
- if(y != 1){
- if(main_maze[y-2][x] == pass||
- main_maze[y-2][x] == room)
- a+=1;
- }
- else a+=1;
- if(x != width-2){
- if(main_maze[y][x+2] == pass||
- main_maze[y][x+2] == room)
- a+=1;
- }
- else a+=1;
- if(y != height-2){
- if(main_maze[y+2][x] == pass||
- main_maze[y+2][x] == room)
- a+=1;
- }
- else a+=1;
- if(a == 4)
- return true;
- else
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement