Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- the_dungeons_rooms = input().split('|')
- initial_health = 100
- initial_bitcoins = 0
- best_room = 0
- count = 0
- for each in the_dungeons_rooms:
- part = list(map(str, each.split()))
- command = part[0]
- number = int(part[1])
- if command == 'potion':
- best_room += 1
- count += 1
- hp = initial_health
- initial_health += int(number)
- if initial_health > 100:
- initial_health = 100
- hp = initial_health - hp
- print(f"You healed for {hp} hp.")
- print(f"Current health: {initial_health} hp.")
- else:
- initial_health = initial_health
- hp = initial_health - hp
- print(f"You healed for {hp} hp.")
- print(f"Current health: {initial_health} hp.")
- elif command == 'chest':
- best_room += 1
- count += 1
- if not initial_health <= 0:
- initial_bitcoins += int(number)
- print(f"You found {int(number)} bitcoins.")
- else:
- initial_health -= int(number)
- best_room += 1
- if not initial_health <= 0:
- count += 1
- print(f"You slayed {command}.")
- else:
- print(f"You died! Killed by {command}.")
- print(f"Best room: {best_room}")
- if best_room == count:
- print("You've made it!")
- print(f"Bitcoins: {initial_bitcoins}")
- print(f"Health: {initial_health}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement