Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- travel_route = input().split("||")
- starting_fuel = int(input())
- starting_ammunition = int(input())
- for route in travel_route:
- command_args = route.split()
- command = command_args[0]
- amount = command_args[1]
- amount = int(amount)
- if command == "Travel":
- distance = amount
- starting_fuel -= distance
- if starting_fuel > amount:
- print(f"The spaceship travelled {distance} light-years.")
- else:
- print("Mission failed.")
- break
- elif command == "Enemy":
- enemy_armor = amount
- if starting_ammunition >= enemy_armor:
- starting_ammunition -= enemy_armor
- print(f"An enemy with {enemy_armor} armour is defeated.")
- else:
- run_fuel = (starting_ammunition - enemy_armor) * 2
- starting_fuel -= abs(run_fuel)
- print(f"n enemy with {enemy_armor} armour is outmaneuvered.")
- elif command == "Repair":
- resources = amount
- starting_fuel += resources
- starting_ammunition += amount * 2
- print(f"Ammunitions added: {(resources * 2)}.")
- print(f"Fuel added: {resources}.")
- if command == "Titan":
- print("You have reached Titan, all passengers are safe.")
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement