-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdriver.py
67 lines (53 loc) · 1.14 KB
/
driver.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
"""
NAME: Naveen Venkat
ID: 2015A7PS0078P
"""
from graphics import *
from modules import *
import config
# ==================================
# MAIN FUNCTION : DRIVER STARTS HERE
# ==================================
def main():
inp = 0
while(inp!=5):
if config.gui:
gui_menu()
else:
menu()
inp = int(raw_input("Enter an option: "))
if (inp==1):
if config.gui:
gui_print_board()
else:
print
print_board(TreeNode.initial_state(16))
elif (inp==2):
if config.gui:
config.R4 = time()
play_gui_minimax_game()
print "Game is running ..."
else:
play_console_minimax_game()
elif (inp==3):
if config.gui:
config.R8 = time()
play_gui_alphabeta_game()
config.R8 = time() - config.R8
print "Game is running ..."
else:
play_console_alphabeta_game()
elif (inp==4):
if config.gui:
gui_publish_stats()
else:
publish_minimax_stats()
publish_alphabeta_stats()
publish_comparative_stats()
print
raw_input("press enter to continue ...")
elif (inp==5):
break
else:
print "Wrong option. Try again"
main()