Skip to content

Instantly share code, notes, and snippets.

@rhettallain
Created February 9, 2014 23:25
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 rhettallain/8907714 to your computer and use it in GitHub Desktop.
Save rhettallain/8907714 to your computer and use it in GitHub Desktop.
simulation of flappy bird
from pylab import *
import random as rd
total=150
p=.587
np=[]
sp=[]
n=0
while n<total:
temp=rd.random()
tempscore=0
while temp>=p:
tempscore=tempscore+1
temp=rd.random()
n=n+1
np=np+[n]
sp=sp+[tempscore]
scatter(np,sp, s=40)
xlabel('Number of Trials')
ylabel('Score')
show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment