Skip to content

Instantly share code, notes, and snippets.

@vikitripathi
Last active August 29, 2015 14:23
Show Gist options
  • Save vikitripathi/bd614870b4c6c48d720a to your computer and use it in GitHub Desktop.
Save vikitripathi/bd614870b4c6c48d720a to your computer and use it in GitHub Desktop.
coding game :
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