Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- bases=[0,0,0] #first, second, third, 0 means no one there 1 means someone is there
- runs=0
- cont=1
- while cont==1:
- hitType=random.randint(1,2)
- # single
- if hitType==1:
- print("single!")
- if bases[2]==1:
- runs+=1
- bases[2]=bases[1]
- bases[1]=bases[0]
- bases[0]=1
- #double
- if hitType==2:
- print("double!")
- # guy from 3rd base scores
- if bases[2]==1:
- runs+=1
- #guy from 2nd base scores!!!
- if bases[1]==1:
- runs+=1
- bases[2]=bases[0]
- bases[1]=1
- bases[0]=0
- print(bases)
- print(runs)
- cont=int(input("Do you want to continue? 1=Yes 2=No"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement