Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- initial_items = input().split(', ')
- while True:
- tokens = input().split(' - ')
- if tokens[0] == 'Craft!':
- print(', '.join(initial_items))
- break
- else:
- command = tokens[0]
- value = tokens[1]
- if command == 'Collect':
- if value not in initial_items:
- initial_items.append(value)
- elif command == 'Drop':
- if value in initial_items:
- initial_items.remove(value)
- elif command == 'Combine Items':
- items = value.split(':')
- old_item = items[0]
- new_item = items[1]
- if old_item in initial_items:
- initial_items.insert(initial_items.index(old_item) + 1, new_item)
- elif command == 'Renew':
- if value in initial_items:
- initial_items.append(initial_items.pop(initial_items.index(value)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement