-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·36 lines (31 loc) · 856 Bytes
/
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
35
36
import sys
import minimax
import game
import utils
import heuristics as h
import verify_heuristics as vh
def main(board, server_moves):
# board = [
# [0, 0, 0, 0, 0],
# [0, 0, 0, 0, 0, 0],
# [0, 1, 0, 0, 0, 0, 0],
# [0, 0, 0, 0, 0, 0, 0, 0],
# [0, 0, 0, 1, 2, 0, 0, 0, 0],
# [0, 0, 0, 0, 1, 2, 0, 0, 0, 0],
# [1, 0, 0, 0, 0, 0, 0, 0, 0],
# [1, 0, 0, 0, 0, 0, 0, 0],
# [1, 0, 0, 0, 0, 0, 0],
# [0, 0, 0, 0, 0, 0],
# [0, 0, 0, 0, 0]
# ]
heuristics = vh.verify_heuristics(board, sys.argv[1])
#heuristics = None
if heuristics == None:
return game.game(sys.argv[1], board, server_moves)
elif (heuristics[0]+1, heuristics[1]+1) not in server_moves:
return game.game(sys.argv[1], board, server_moves)
else:
print('best move: ' + str(heuristics))
return heuristics
if __name__ == "__main__":
main(sys.argv, [])