25 lines
343 B
Ruby
25 lines
343 B
Ruby
|
if ARGV[0] == "2"
|
||
|
require_relative "impl_2"
|
||
|
else
|
||
|
require_relative "impl"
|
||
|
end
|
||
|
|
||
|
|
||
|
def print(result)
|
||
|
if result.is_a? Array
|
||
|
result.map! {|l| "#{l}\n" }
|
||
|
end
|
||
|
|
||
|
puts result
|
||
|
end
|
||
|
|
||
|
def run
|
||
|
puts "running your implementation"
|
||
|
input = File.new("day_3/data").read
|
||
|
data = parse(input)
|
||
|
result = calculate(data)
|
||
|
print(result)
|
||
|
end
|
||
|
|
||
|
run
|