Created
June 24, 2017 14:38
-
-
Save rvcx/c6d1dd78ebe2e0ac88fe9471b01a1a5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def simulate(strategies, turns): | |
pot = 1.0 | |
players = [ [s, 0] for s in strategies ] | |
for i in range(turns): | |
p = random.choice(players) | |
if p[0] > pot: | |
pot = 1.0 | |
else: | |
p[1] += p[0] | |
pot -= p[0] | |
return players |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment