Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #basic game using functions
- def live():
- print("You have survived the game! Well done!!!")
- def die():
- print("You have died! Better luck next time!!!")
- def password():
- c5 = input("What is the password?")
- if c5=="1234":
- print("The man shows you the way out to freedom!")
- live()
- else:
- print("You gave the wrong password, the man pulls out his gun.")
- die()
- def garden():
- print("You find yourself in a garden with a cave and a person")
- c1 = input("(E)nter the cave or (S)peak to the person?")
- if c1 =="e":
- print("The cave is full of rats!!!")
- die()
- elif c1=="s":
- print("You speak to the person and he asks you for a password.")
- password()
- print("You are in a room with 2 doors.")
- c2 = input("(L)eft door or (R)ight door?")
- if c2=="l":
- garden()
- elif c2=="r":
- print("You enter a room with a window and a door.")
- c3 = input("Climb out of the (W)indow or use the (D)oor?")
- if c3=="w":
- garden()
- elif c3=="d":
- print("You enter a kitchen with a window and a person.")
- c4 = input("(S)peak to the person or climb out of the (W)indow?")
- if c4=="s":
- print("The person tells you a password '1234' and takes you to the garden.")
- garden()
- elif c4=="w":
- print("The window is on the 20th floor of a skyscraper, you fall to your death!")
- die()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement