Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- health = 100
- bitcoins = 0
- rooms = input().split('|')
- for i in range(len(rooms)):
- tokens = rooms[i].split(' ')
- command = tokens[0]
- amount = int(tokens[1])
- if command == "potion":
- if health + amount > 100:
- amount = 100 - health
- health += amount
- print(f"You healed for {amount} hp.\nCurrent health: {health} hp.")
- elif command == "chest":
- bitcoins += amount
- print(f"You found {amount} bitcoins.")
- else:
- health -= amount
- if health <= 0:
- print(f"You died! Killed by {command}.\nBest room: {i + 1}")
- exit(0)
- print(f"You slayed {command}.")
- print(f"You've made it!\nBitcoins: {bitcoins}\nHealth: {health}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement