Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check_successfully(corresponding):
- count = 0
- for key in corresponding:
- if corresponding[key] >= 3:
- count += 1
- if count == 3:
- return True
- else:
- return False
- bomb_corresponding = {40: 0, 60: 0, 120: 0}
- bomb_effects = list(map(int, input().split(", ")))
- bomb_casing = list(map(int, input().split(", ")))
- is_successfully = False
- while len(bomb_effects) != 0 or len(bomb_casing) != 0:
- if check_successfully(bomb_corresponding):
- is_successfully = True
- break
- sum_of_effects_and_casing = bomb_effects[0] + bomb_casing[-1]
- if sum_of_effects_and_casing in bomb_corresponding:
- bomb_corresponding[sum_of_effects_and_casing] += 1
- bomb_effects.pop(0)
- bomb_casing.pop()
- else:
- bomb_casing[-1] -= 5
- if is_successfully:
- print("Bene! You have successfully filled the bomb pouch!")
- else:
- print("You don't have enough materials to fill the bomb pouch.")
- if len(bomb_effects) == 0:
- print("Bomb Effects: empty")
- else:
- print(f"Bomb Effects: {', '.join(map(str, bomb_effects))}")
- if len(bomb_casing) == 0:
- print("Bomb Casings: empty")
- else:
- print(f"Bomb Casings: {', '.join(map(str, bomb_casing))}")
- print(f"Cherry Bombs: {bomb_corresponding[60]}")
- print(f"Datura Bombs: {bomb_corresponding[40]}")
- print(f"Smoke Decoy Bombs: {bomb_corresponding[120]}")
Advertisement
Add Comment
Please, Sign In to add comment