Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- neighborhood = [int(x) for x in input().split("@")]
- last_position = 0
- command = input()
- while not command == 'Love!':
- command, jump_value = command.split()
- jump_value = int(jump_value)
- jump_length = jump_value + last_position
- if jump_length >= len(neighborhood):
- jump_length = 0
- if neighborhood[jump_length] == 0:
- print(f"Place {jump_length} already had Valentine's day.")
- command = input()
- last_position = int(jump_length)
- continue
- else:
- neighborhood[jump_length] -= 2
- last_position = int(jump_length)
- if neighborhood[jump_length] == 0:
- print(f"Place {jump_length} has Valentine's day.")
- command = input()
- print(f"Cupid's last position was {last_position}.")
- counter_fails = 0
- for jump in neighborhood:
- if int(jump) != 0:
- counter_fails += 1
- if counter_fails == 0:
- print(f"Mission was successful.")
- else:
- print(f"Cupid has failed {counter_fails} places.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement