Skip to content

Instantly share code, notes, and snippets.

@ravgoundar
Created February 8, 2015 02:08
Show Gist options
  • Save ravgoundar/f6282ca1715121d7753c to your computer and use it in GitHub Desktop.
Save ravgoundar/f6282ca1715121d7753c to your computer and use it in GitHub Desktop.
CodinGame - Easy - The Descent
while (true) {
var inputs = readline().split(' ');
var SX = parseInt(inputs[0]);
var SY = parseInt(inputs[1]);
var maxHeight = 0;
var target = null;
for (var i = 0; i < 8; i++) {
var MH = parseInt(readline());
if (MH >= maxHeight) {
maxHeight = MH;
target = i;
}
}
if (SX == target) {
print('FIRE');
} else {
print('HOLD');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment