Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint as roll
- winrate=50 #preceantage you wish to predict
- time=[]
- quick=9999999999 #arbitrarily large number
- for x in range(50):
- wins=0 #net positive wins
- totalgames=0
- while wins<25: #25 wins is legend
- if roll(1,100)<=winrate: wins+=1
- else:
- if wins>0: wins-=1 #rank 5 floor
- totalgames+=1
- print("trial "+str(x+1)+": total games to legend at "+str(winrate)+"%: "+str(totalgames))
- if totalgames<quick: quick=totalgames
- time.append(totalgames)
- print("\n"+str(int(sum(time)/len(time)/12))+" hours on average to reach legend with a "+str(winrate)+"% winrate.\nLuckiest player: "+str(quick)+" games and "+str(int(quick/12))+" hours.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement