Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import deque
- bombs_template = {40: 'Datura Bombs', 60: 'Cherry Bombs', 120: 'Smoke Decoy Bombs'}
- bombs_made = {"Cherry Bombs": 0, "Datura Bombs": 0, "Smoke Decoy Bombs": 0}
- bombs_effect_que = deque([int(n) for n in input().split(', ')])
- bombs_casing_stack = [int(n) for n in input().split(', ')]
- while (bombs_effect_que and bombs_casing_stack) and (bombs_made["Cherry Bombs"] < 3 or bombs_made["Datura Bombs"] < 3
- or bombs_made["Smoke Decoy Bombs"] < 3):
- current_bomb_effect = bombs_effect_que[0]
- current_casing = bombs_casing_stack[-1]
- current_sum = current_bomb_effect + current_casing
- if current_sum in bombs_template:
- bombs_made[bombs_template[current_sum]] += 1
- bombs_effect_que.popleft()
- bombs_casing_stack.pop()
- continue
- bombs_casing_stack[-1] -= 5
- if bombs_made["Cherry Bombs"] >= 3 and bombs_made["Datura Bombs"] >= 3 and bombs_made["Smoke Decoy Bombs"] >= 3:
- print("Bene! You have successfully filled the bomb pouch!")
- else:
- print("You don't have enough materials to fill the bomb pouch.")
- if not bombs_effect_que:
- print("Bomb Effects: empty")
- else:
- print(f"Bomb Effects: {', '.join([str(n) for n in bombs_effect_que])}")
- if not bombs_casing_stack:
- print("Bomb Casings: empty")
- else:
- print(f"Bomb Casings: {', '.join([str(n) for n in bombs_casing_stack])}")
- for bomb_type, count in sorted(bombs_made.items()):
- print(f"{bomb_type}: {count}")
Advertisement
Add Comment
Please, Sign In to add comment