pacho_the_python

LEgendary Farming

Mar 14th, 2022
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.43 KB | None | 0 0
  1. material_data = input().split(" ")
  2.  
  3.  
  4. legend_data = {"shards": 0, "fragments": 0, "motes": 0}
  5. junk_data = {}
  6.  
  7. stop_condition = False
  8.  
  9. while True:
  10.  
  11.     materials = []
  12.  
  13.     for material in material_data:
  14.         materials.append(material.lower())
  15.  
  16.     for i in range(0, len(materials), 2):
  17.         special_item = ""
  18.         item = materials[i + 1]
  19.         quantity = int(materials[i])
  20.         if item in ["shards", "fragments", "motes"]:
  21.             if item not in legend_data:
  22.                 legend_data[item] = quantity
  23.             else:
  24.                 legend_data[item] += quantity
  25.  
  26.             if legend_data[item] >= 250:
  27.                 legend_data[item] -= 250
  28.  
  29.                 if item == "shards":
  30.                     special_item = "Shadowmourne"
  31.                 elif item == "fragments":
  32.                     special_item = "Valanyr"
  33.                 elif item == "motes":
  34.                     special_item = "Dragonwrath"
  35.  
  36.                 stop_condition = True
  37.         else:
  38.             if item not in junk_data:
  39.                 junk_data[item] = quantity
  40.             else:
  41.                 junk_data[item] += quantity
  42.  
  43.         if stop_condition:
  44.             print(f"{special_item} obtained!")
  45.             break
  46.  
  47.     if stop_condition:
  48.         break
  49.  
  50.     material_data = input().split(" ")
  51.  
  52. for i in legend_data:
  53.     print(f"{i}: {legend_data[i]}")
  54.  
  55. for y in junk_data:
  56.     print(f"{y}: {junk_data[y]}")
  57.  
Advertisement
Add Comment
Please, Sign In to add comment