Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dungenons_rooms = input().split("|")
- bitcoins_counter = 0
- health_counter = 100
- room_counter = 0
- for elem in range(len(dungenons_rooms)):
- command = dungenons_rooms[elem].split()[0]
- number = int(dungenons_rooms[elem].split()[1])
- room_counter += 1
- if command == "potion":
- if health_counter + number > 100:
- number = 100 - health_counter
- health_counter += number
- print(f"You healed for {number} hp.")
- print(f"Current health: {health_counter} hp.")
- elif command == "chest":
- bitcoins_counter += number
- print(f"You found {number} bitcoins.")
- else:
- if health_counter - number > 0:
- print(f"You slayed {command}.")
- health_counter -= number
- else:
- print(f"You died! Killed by {command}.")
- print(f"Best room: {room_counter}")
- exit()
- if room_counter == len(dungenons_rooms):
- print(f"You've made it!", f"Bitcoins: {bitcoins_counter}", f"Health: {health_counter}", sep='\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement