Advertisement
bl00dt3ars

02. MuOnline (delyans)

Jul 3rd, 2021
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. dungenons_rooms = input().split("|")
  2.  
  3. bitcoins_counter = 0
  4. health_counter = 100
  5. room_counter = 0
  6.  
  7. for elem in range(len(dungenons_rooms)):
  8.     command = dungenons_rooms[elem].split()[0]
  9.     number = int(dungenons_rooms[elem].split()[1])
  10.     room_counter += 1
  11.     if command == "potion":
  12.         if health_counter + number > 100:
  13.             number = 100 - health_counter
  14.         health_counter += number
  15.         print(f"You healed for {number} hp.")
  16.         print(f"Current health: {health_counter} hp.")
  17.     elif command == "chest":
  18.         bitcoins_counter += number
  19.         print(f"You found {number} bitcoins.")
  20.     else:
  21.         if health_counter - number > 0:
  22.             print(f"You slayed {command}.")
  23.             health_counter -= number
  24.         else:
  25.             print(f"You died! Killed by {command}.")
  26.             print(f"Best room: {room_counter}")
  27.             exit()
  28.  
  29. if room_counter == len(dungenons_rooms):
  30.     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