Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- lives = 3
- score = 0
- while lives>0:
- weapon = int(input("Choose your weapon (0,1,2): "))
- r = random.randrange(100)
- if weapon==0: # Twig
- if r<10: # 10% chance to win
- print( "The rabbit was defeated!")
- score += 1000
- score = print("Your score is now", score)
- else:
- print( "You have died a slow and miserable death!" )
- lives -= 1
- print( "You now have", lives, "lives left")
- elif weapon==1: # Sharpened Stick
- if r<20: # 20% chance to win
- print( "Right through the heart!")
- score += 900
- print("Your score is now", score)
- else:
- print( "Did you really think a stick would work?" )
- lives -= 1
- print( "You have", lives, "lives remaining")
- elif weapon==2: # Rock
- if r<30: # 30% chance to win
- print( "You sure rocked that rabbit!")
- score += 800
- print("Your score is now", score)
- else:
- print( "The rabbit seems to be immune to rocks!" )
- lives -= 1
- print( "You have", lives, "lives remaining")
Add Comment
Please, Sign In to add comment