maze based on bfs(non-nested function call)

maze based on bfs(non-nested function call)