Advertisement
horozov86

Legendary Farming

Mar 20th, 2023
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. special_materials = {
  2.     "shards": 0,
  3.     "fragments": 0,
  4.     "motes": 0
  5. }
  6.  
  7. junk_materials = {}
  8.  
  9. flag = False
  10. while not flag:
  11.     line = input()
  12.     materials = line.split()
  13.  
  14.     for i in range(0, len(materials), 2):
  15.         quantity = int(materials[i])
  16.         material = materials[i + 1].lower()
  17.  
  18.         if material in special_materials:
  19.             special_materials[material] += quantity
  20.             if special_materials[material] >= 250:
  21.                 special_materials[material] -= 250
  22.                 flag = True
  23.                 if material == "shards":
  24.                     print(f"Shadowmourne obtained!")
  25.                 if material == "fragments":
  26.                     print(f"Valanyr obtained!")
  27.                 if material == "motes":
  28.                     print(f"Dragonwrath obtained!")
  29.                 break
  30.  
  31.         else:
  32.             if material in junk_materials:
  33.                 junk_materials[material] += quantity
  34.             else:
  35.                 junk_materials[material] = quantity
  36.  
  37. for material, count in special_materials.items():
  38.     print(f"{material}: {count}")
  39.  
  40. for material, count in junk_materials.items():
  41.     print(f"{material}: {count}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement