Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. from random import randint as roll
  2. winrate=50 #preceantage you wish to predict
  3. time=[]
  4. quick=9999999999 #arbitrarily large number
  5.  
  6. for x in range(50):
  7.     wins=0 #net positive wins
  8.     totalgames=0
  9.     while wins<25: #25 wins is legend
  10.         if roll(1,100)<=winrate: wins+=1
  11.         else:
  12.             if wins>0: wins-=1 #rank 5 floor
  13.         totalgames+=1
  14.     print("trial "+str(x+1)+": total games to legend at "+str(winrate)+"%: "+str(totalgames))
  15.     if totalgames<quick: quick=totalgames
  16.     time.append(totalgames)
  17.  
  18. 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