-
Notifications
You must be signed in to change notification settings - Fork 0
/
monopolySim.py
45 lines (35 loc) · 931 Bytes
/
monopolySim.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
from collections import Counter
import sys
import Players
winners = {}
players = []
def startSim(p,num):
players = p
for i in range(0,int(num)):
import monopoly
winner = monopoly.playGame(players)
if winner in winners:
winners[winner] += 1
else:
winners[winner] = 1
del sys.modules['monopoly']
return players
"""
numplayers = input("Number of players: ")
for p in range(0,int(numplayers)):
print("1. Aggressive")
print("2. First Half")
print("3. Second Half")
print("4. Random")
choice = input("Select a strategy:")
players.append(choice)
num = input("Number of iterations: ")
for i in range(0,int(num)):
import monopoly
winner = monopoly.playGame(players)
if winner in winners:
winners[winner] += 1
else:
winners[winner] = 1
del sys.modules['monopoly']
print(winners) """