Created
April 22, 2016 03:48
-
-
Save dukeimg/cdc8bb1f6d3c1769a908d41c00a6e868 to your computer and use it in GitHub Desktop.
The Descent
This file contains hidden or 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
STDOUT.sync = true # DO NOT REMOVE | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
# game loop | |
loop do | |
highest = 0 | |
index = 0 | |
8.times do |n| | |
mountain_h = gets.to_i # represents the height of one mountain, from 9 to 0. | |
if mountain_h > highest | |
highest = mountain_h | |
index = n | |
end | |
end | |
# Write an action using puts | |
# To debug: STDERR.puts "Debug messages..." | |
puts index # The number of the mountain to fire on. | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment