Created
February 21, 2017 11:17
-
-
Save shredding/2102b3bf4ba7e32e4ed3a896d6dce816 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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