-
Notifications
You must be signed in to change notification settings - Fork 0
/
mctsPlay.py
51 lines (41 loc) · 1.48 KB
/
mctsPlay.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
from MCTS.draft import Draft
from heuristics.heuristics import alphabetic, valuation, amateur
rollouts = input("Choose the number of rollouts done per draft selection, "
"recommended 1000-1500:")
heuristic = input("Choose the heuristic to use. Choices are 'alphabetic', "
"'valuation' (pro), or amateur:")
if heuristic == "alphabetic":
func = alphabetic
elif heuristic == "valuation":
func = valuation
else:
func = amateur
game = Draft(func, int(rollouts), 1.41)
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.is_terminal():
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.is_terminal():
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.is_terminal():
champion = game.getMove()
game.makeMove(champion)
game.printDraft()