daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2.  
  3. bases=[0,0,0] #first, second, third, 0 means no one there 1 means someone is there
  4. runs=0
  5. cont=1
  6. while cont==1:
  7.     hitType=random.randint(1,2)
  8. # single
  9.     if hitType==1:
  10. print("single!")
  11. if bases[2]==1:
  12.             runs+=1
  13.         bases[2]=bases[1]
  14.         bases[1]=bases[0]
  15.         bases[0]=1
  16.     #double
  17.     if hitType==2:
  18. print("double!")
  19. # guy from 3rd base scores
  20.         if bases[2]==1:
  21.             runs+=1
  22.         #guy from 2nd base scores!!!
  23.         if bases[1]==1:
  24.             runs+=1
  25.         bases[2]=bases[0]
  26.         bases[1]=1
  27.         bases[0]=0
  28.  
  29.     print(bases)
  30. print(runs)
  31.     cont=int(input("Do you want to continue? 1=Yes 2=No"))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top