Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- targets = list(map(int, input().split()))
- while True:
- command = input().split()
- if command[0] == "End":
- break
- action = command[0]
- index = int(command[1])
- value2 = int(command[2])
- if "Shoot" in command and 0 <= index < len(targets):
- if targets[index] - value2 <= 0:
- targets.pop(index)
- else:
- targets[index] -= value2
- if "Add" in command and 0 <= index < len(targets):
- targets.insert(index, value2)
- elif "Add" in command:
- print("Invalid placement!")
- if "Strike" in command and 0 <= (index - value2) < len(targets) and 0 <= (index + value2) < len(targets):
- for i in range((index + value2), (index - value2) - 1, -1):
- targets.pop(i)
- elif "Strike" in command:
- print("Strike missed!")
- print('|'.join([str(n) for n in targets]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement