swinch

ultra jump python script

Sep 20th, 2018
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.68 KB | None | 0 0
  1. ultra jump.py
  2.  
  3. def axems(pink,black,red,yellow):
  4.     import random
  5.     times=0
  6.     count=0
  7.     num = 1000000 #number of samples
  8.     while times<num:
  9.         p=1 #pink targeted
  10.         b=0
  11.         r=0
  12.         y=0
  13.         count=count+1 #counting the first jump
  14.         while p<pink or b<black or r<red or y<yellow:
  15.             x = random.randint(1,4)
  16.             if x==1:
  17.                 p=p+1
  18.             elif x==2:
  19.                 b=b+1
  20.             elif x==3:
  21.                 r=r+1
  22.             elif x==4:
  23.                 y=y+1
  24.             count = count + 1
  25.         times=times+1
  26.     print(count/num) #average
  27.  
  28. def countdown(left,right,cd):
  29.     import random
  30.     times=0
  31.     count=0
  32.     num = 1000000 #number of samples
  33.     while times<num:
  34.         l=0
  35.         r=0
  36.         c=1
  37.         count=count+1 #counting the first jump
  38.         while c<cd or l<left or r<right:
  39.             x = random.randint(1,3)
  40.             if x==1:
  41.                 l=l+1
  42.             elif x==2:
  43.                 r=r+1
  44.             elif x==3:
  45.                 c=c+1
  46.             count = count + 1
  47.         times=times+1
  48.     print(count/num) #average
  49.  
  50. def gunyolk(gun,chief):
  51.     import random
  52.     times=0
  53.     count=0
  54.     num = 1000000 #number of samples
  55.     while times<num:
  56.         g=1
  57.         c=0
  58.         count=count+1 #counting the first jump
  59.         while g<gun or c<chief:
  60.             x = random.randint(1,2)
  61.             if x==1:
  62.                 g=g+1
  63.             elif x==2:
  64.                 c=c+1
  65.             count = count + 1
  66.         times=times+1
  67.     print(count/num) #average
  68.  
  69. def main():  
  70.     axems(1,1,1,1)
  71.     axems(4,1,1,1)
  72.     countdown(1,1,1)
  73.     gunyolk(1,1)
  74.    
  75. main()
Advertisement
Add Comment
Please, Sign In to add comment