-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmin_vs_monte.py
63 lines (48 loc) · 1.49 KB
/
min_vs_monte.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
from utils import *
def min_vs_monte(heuristic1):
board = []
for i in range(24):
board.append("x")
# board = generateRandomBoard_stage2()
evaluation = evaluate()
print("Stage 1")
for i in range(9):
printBoard(board)
count(board)
print("Monte turn: ")
board = mc(board,"A",1,100)
h = heuristic1(board,True)
if h == float('inf'):
print("Monte WON!!!!!!!!")
exit(0)
printBoard(board)
count(board)
print("Min_max turn: ")
evalBoard = minimax(
board, ai_depth, False, alpha, beta, True, heuristic1)
if evalBoard.evaluate == float('-inf'):
print("Min-Max has won!")
exit(0)
else:
board = evalBoard.board
print("Stage 2")
while True:
count(board)
printBoard(board)
print("Monte turn: ")
board = mc(board,"A",0,100)
h = heuristic1(board,True)
if h == float('inf'):
print("Monte WON!!!!!!!!")
exit(0)
count(board)
printBoard(board)
print("Min_max turn: ")
evaluation = minimax(
board, ai_depth, False, alpha, beta, False, heuristic1)
if evaluation.evaluate == float('-inf'):
print("Min-Max has won")
exit(0)
else:
board = evaluation.board
min_vs_monte(potentialMillsHeuristic)