forked from matthewjwolff/LoveLetter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runs.py
47 lines (39 loc) · 1.1 KB
/
runs.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
'''
Created on Nov 3, 2016
@author: mjw
'''
from player.RandomAI import RandomAI
from engine.GameEngine import GameEngine
from debug.DebugEngine import DebugEngine
from interface.StdoutInterface import StdoutInterface
from player.EasyAI import EasyAI
from player.HardAI import HardAI
def main():
# random, easy, aggressive, defensive
wins = [0, 0, 0, 0]
for i in range(20):
game = GameEngine()
p1 = RandomAI()
p2 = RandomAI()
p3 = RandomAI()
p4 = RandomAI()
game.addPlayer(p1)
game.addPlayer(p2)
game.addPlayer(p3)
game.addPlayer(p4)
winner = game.runGame()
print ("The winner of the game "+ str(i) +" is "+str(winner))
if winner == p1:
wins[0] += 1
elif winner == p2:
wins[1] += 1
elif winner == p3:
wins[2] += 1
else:
wins[3] += 1
print("Random1 Wins: " + str(wins[0]))
print("Random2 Wins: " + str(wins[1]))
print("Random3 Wins: " + str(wins[2]))
print("Random4 Wins: " + str(wins[3]))
if __name__ == '__main__':
main()