-
Notifications
You must be signed in to change notification settings - Fork 0
/
TakingInputs.py
120 lines (79 loc) · 3.28 KB
/
TakingInputs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import os
os.system('color')
from termcolor import colored
def main():
print(colored("\nLet's Start the Maze Solver Game","red","on_white"))
n = int(input("\nEnter the size of the maze (n*n) :- "))
print()
maze = generate_maze(n)
print_maze(maze)
# print(maze)
while True:
print("\n1. Print the Path ")
print("2. Generate another Maze ")
print("3. Exit the Game ❌\n")
players_choice=int(input("Enter Your Choice (1/2/3)❓❓:- "))
# if players_choice==1:
# solution = solve_maze(maze)
# # print(maze)
# if solution:
# print(colored("\nPath Found \n","green","on_white"))
# print_maze(solution)
# else:
# print(colored("\nNo path found \n","red","on_white"))
if players_choice==1:
solution = solve_maze(maze)
# print(maze)
if solution:
print(colored("\nPath Found \n","green","on_white"))
print_maze(maze)
else:
print(colored("\nNo path found \n","red","on_white"))
elif players_choice==2:
n = int(input("\nEnter the size of the maze (n*n) :- "))
maze = generate_maze(n)
# print(maze)
print(colored("\nMaze Generated 👇","blue"))
print()
print_maze(maze)
elif players_choice == 3:
print("\nThank you for playing the Maze Solver Game.\n")
break
else:
players_choice=int(input("Enter Your Choice (1/2/3)❓❓:- "))
if __name__ == "__main__":
main()
# def main():
# print(colored("\nLet's Start the Maze Solver Game","red","on_white"))
# n = int(input("\nEnter the size of the maze (n*n) :- "))
# print()
# maze = generate_maze(n)
# print_maze(maze)
# # print(maze)
# while True:
# print("\n1. Print the Path ")
# print("2. Generate another Maze ")
# print("3. Exit the Game ❌\n")
# players_choice=int(input("Enter Your Choice (1/2/3)❓❓:- "))
# if players_choice==1:
# solution = solve_maze(maze)
# # print(maze)
# if solution:
# print(colored("\nPath Found \n","green","on_white"))
# print_maze(solution)
# else:
# print(colored("\nNo path found \n","red","on_white"))
# elif players_choice==2:
# n = int(input("\nEnter the size of the maze (n*n) :- "))
# maze = generate_maze(n)
# # print(maze)
# print(colored("\nMaze Generated 👇","blue"))
# print()
# print_maze(maze)
# elif players_choice == 3:
# print("\nThank you for playing the Maze Solver Game.\n")
# break
# else:
# players_choice=int(input("Enter Your Choice (1/2/3)❓❓:- "))
# if __name__ == "__main__":
# main()