Guest User

Untitled

a guest
Jul 2nd, 2020
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.15 KB | None | 0 0
  1. items = input().split(", ")
  2. command_input = input()
  3.  
  4.  
  5. while command_input != "Craft!":
  6.     command_token = command_input.split(" - ")
  7.     command = command_token[0]
  8.     item = command_token[1]
  9.     if command == "Collect":
  10.         if item in items:
  11.             command_input = input()
  12.         else:
  13.             items.append(item)
  14.             command_input = input()
  15.     elif command == "Drop":
  16.         if item in items:
  17.                 items.remove(item)
  18.                 command_input = input()
  19.         else:
  20.             command_input = input()
  21.     elif command == "Combine Items":
  22.         combine_items = item.split(":")
  23.         old_item = combine_items[0]
  24.         new_item = combine_items[1]
  25.         if old_item in items:
  26.             items.append(new_item)
  27.             command_input = input()
  28.         else:
  29.             command_input = input()
  30.     elif command == "Renew":
  31.         if items[-1] == item:
  32.             command_input = input()
  33.         elif item in items:
  34.             items.append(items.pop(items.index(item)))
  35.             command_input = input()
  36.         else:
  37.             command_input = input()
  38.  
  39. print(", ".join(items))
Add Comment
Please, Sign In to add comment