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. | |
# --- | |
# Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow your orders. | |
# light_x: the X position of the light of power | |
# light_y: the Y position of the light of power | |
# initial_tx: Thor's starting X position | |
# initial_ty: Thor's starting Y position |
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 | |
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. | |
@surface_n = gets.to_i # the number of points used to draw the surface of Mars. | |
@surface_n.times do | |
# land_x: X coordinate of a surface point. (0 to 6999) | |
# land_y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars. | |
land_x, land_y = gets.split(" ").collect {|x| x.to_i} | |
end |
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
require './lib/scheme' | |
describe Scheme do | |
describe '.check' do | |
let(:scheme) { Scheme.new(:height => 4, :width => 4, | |
:cells => [ | |
['0', '0', '.', '0'], | |
['0', '.', '0', '0'], | |
['.', '0', '.', '0'], |
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
@ECHO OFF | |
IF NOT "%~f0" == "~f0" GOTO :WinNT | |
ECHO.This version of Ruby has not been built with support for Windows 95/98/Me. | |
GOTO :EOF | |
:WinNT | |
@"%~dp0ruby.exe" "%~dpn0" %* |
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
def flatten(input, output = []) | |
input.each do |el| | |
if el.is_a? Array | |
flatten(el, output) | |
else | |
output << el | |
end | |
end | |
output | |
end |
OlderNewer