-
Notifications
You must be signed in to change notification settings - Fork 0
/
minimaxPlay.py
54 lines (41 loc) · 1.55 KB
/
minimaxPlay.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
from minimax.draft import Draft
from minimax.tree import Tree
from heuristics.heuristics import alphabetic
from heuristics.heuristics import valuation
redDepth = input("Choose the depth of red Team AI for minimax, recommended 2-3:")
blueDepth = input("Choose the depth of blue Team AI for minimax, "
"recommended 2-3:")
heuristic = input("Choose the heuristic to use. Choices are 'alphabetic', or "
"'valuation' (pro):")
if heuristic == "alphabetic":
func = alphabetic
else:
func = valuation
game = Draft(Tree(func), Tree(func), int(blueDepth), int(redDepth))
choice = input("Choose red side or blue side to draft from, or auto to have "
"computer do both sides, " "by entering 'red', 'blue', or 'auto:")
if choice == "blue":
while not game.isTerminal():
if game.isBlueBan():
champion = input("Choose a champion to ban:")
elif game.isBluePick():
champion = input("Choose a champion to pick:")
else:
champion = game.getMove()
game.makeMove(champion)
game.printDraft()
elif choice == "red":
while not game.isTerminal():
if game.isRedBan():
champion = input("Choose a champion to ban:")
elif game.isRedPick():
champion = input("Choose a champion to pick:")
else:
champion = game.getMove()
game.makeMove(champion)
game.printDraft()
else:
while not game.isTerminal():
champion = game.getMove()
game.makeMove(champion)
game.printDraft()