Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key = list(map(int, input().split()))
- treasure_data = input()
- counter_key = 0
- while True:
- if treasure_data == "find":
- break
- treasure_location = ""
- counter_key = 0
- for letter in treasure_data:
- result = (ord(letter) - key[counter_key])
- treasure_location += chr(result)
- counter_key += 1
- if counter_key == len(key):
- counter_key = 0
- ore_location_data = treasure_location.split("&")
- ore = ore_location_data[1]
- location_data = ore_location_data[2]
- location = location_data.split("<")
- result = [x for x in location[1] if x != ">"]
- print(f'Found {ore} at {"".join(result)}')
- treasure_data = input()
Advertisement
Add Comment
Please, Sign In to add comment