Skip to content

Instantly share code, notes, and snippets.

@shredding
Created February 21, 2017 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shredding/2102b3bf4ba7e32e4ed3a896d6dce816 to your computer and use it in GitHub Desktop.
Save shredding/2102b3bf4ba7e32e4ed3a896d6dce816 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
def gto_strategy():
return random.choice(Selection.OPTIONS)
gto_wins = 0
def rock_is_the_thing_strategy():
return 'rock'
rock_wins = 0
for _ in range(1000000):
gto_selection = gto_strategy()
rock_selection = rock_is_the_thing_strategy()
if gto_selection > rock_selection:
gto_wins += 1
if rock_selection > gto_selection:
rock_wins += 1
# I read data smart and know that John Foreman will haunt me down for using a pie-chart,
# but I have the feeling that this time it'll transport percentage distributions well ...
plt.pie(
[gto_wins, rock_wins],
labels=['GTO', 'Rock'],
colors=['lightskyblue', 'lightcoral'],
shadow=True,
radius=2
)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment