-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
34 lines (32 loc) · 1.02 KB
/
main.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
import game
def test():
g = game.Game("Flying Spaghetti Monster", "Bolzano–Weierstrass theorem")
print("Game validity :", g.isValid())
g.nlpMeanPlayer()
print("path :", g.visited)
print("score : ", g.score)
if __name__ == "__main__":
test()
while True:
x = input('New game ? (Y/N) ')
if(x.upper() != 'Y' ):
print("exit")
break
while (True):
start = input('Starting page : ')
end = input('Target page : ')
g = game.Game(start.replace('_', ' '), end.replace('_', ' '))
break
if (g.isValid()):
print("Valid game")
break
else:
print("Invalid inputs, please enter existing pages")
max = input('Maximum number of loaded pages : ')
if(not max):
print("default max = 100\n")
max = 100
g.set_max_iter(int(max))
g.nlpMeanPlayer()
print("path :", g.visited)
print("score : ", g.score)