Last active
August 29, 2015 14:23
-
-
Save vikitripathi/bd614870b4c6c48d720a to your computer and use it in GitHub Desktop.
coding game :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, math | |
# CodinGame planet is being attacked by slimy insectoid aliens. | |
# <--- | |
# Hint:To protect the planet, you can implement the pseudo-code provided in the statement, below the player. | |
# game loop | |
while 1: | |
enemy1 = raw_input() # name of enemy 1 | |
dist1 = int(raw_input()) # distance to enemy 1 | |
enemy2 = raw_input() # name of enemy 2 | |
dist2 = int(raw_input()) # distance to enemy 2 | |
# Write an action using print | |
# To debug: print >> sys.stderr, "Debug messages..." | |
if dist1 > dist2 : | |
print enemy2 | |
else: | |
print enemy1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment