Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- health = 100
- coins = 0
- data = input().split("|")
- completed = True
- for i in range(len(data)):
- key, value = data[i].split()
- value = int(value)
- if key == "potion":
- if health + value > 100:
- value = 100 - health
- health += value
- print(f"You healed for {value} hp.")
- print(f"Current health: {health} hp.")
- elif key == "chest":
- coins += value
- print(f"You found {value} bitcoins.")
- else:
- if health - value > 0:
- print(f"You slayed {key}.")
- health -= value
- else:
- print(f"You died! Killed by {key}.")
- print(f"Best room: {i+1}")
- completed = False
- break
- if completed:
- print(f"You've made it!")
- print(f"Bitcoins: {coins}")
- print(f"Health: {health}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement