From 6cff27d507205a86a6f92d3328cdb55ddf503419 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sun, 10 Dec 2017 21:15:16 -0800 Subject: [PATCH] [2017][ruby][11.x] speedrun --- 2017/input/day_11.rb | 2 ++ 2017/ruby/day_11.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 2017/input/day_11.rb create mode 100644 2017/ruby/day_11.rb diff --git a/2017/input/day_11.rb b/2017/input/day_11.rb new file mode 100644 index 0000000..104c1e0 --- /dev/null +++ b/2017/input/day_11.rb @@ -0,0 +1,2 @@ +se,ne,ne,n,n,n,n,n,n,nw,nw,nw,se,nw,nw,sw,se,nw,sw,nw,se,sw,s,sw,s,s,sw,s,sw,sw,ne,sw,s,sw,s,sw,nw,s,s,s,s,s,s,sw,s,s,n,nw,s,s,se,se,se,s,nw,se,s,se,nw,se,se,n,se,se,se,se,se,se,se,ne,sw,nw,ne,n,se,sw,nw,ne,se,se,ne,sw,se,ne,ne,se,n,ne,ne,ne,ne,ne,ne,sw,ne,ne,ne,ne,ne,ne,sw,ne,nw,s,se,ne,ne,ne,nw,ne,sw,ne,ne,ne,ne,ne,ne,nw,sw,sw,ne,ne,ne,n,s,ne,n,s,n,ne,n,n,n,n,n,n,n,ne,n,n,s,s,ne,n,n,sw,n,sw,n,n,se,n,n,n,n,n,n,n,n,s,sw,ne,nw,nw,n,n,se,se,s,n,nw,n,n,n,nw,n,nw,n,n,nw,se,ne,nw,nw,n,nw,n,nw,s,n,nw,n,ne,n,n,nw,n,nw,se,se,nw,nw,nw,nw,n,nw,ne,ne,n,s,nw,nw,nw,nw,n,nw,sw,se,nw,nw,nw,sw,nw,s,nw,nw,nw,nw,nw,se,n,ne,nw,ne,sw,sw,nw,sw,s,nw,nw,ne,nw,sw,nw,sw,nw,n,n,sw,nw,nw,n,ne,s,ne,sw,ne,nw,nw,sw,nw,nw,s,nw,nw,nw,nw,nw,nw,sw,sw,nw,nw,se,nw,sw,nw,ne,sw,sw,nw,nw,nw,nw,nw,s,sw,nw,sw,sw,nw,nw,sw,sw,sw,sw,sw,sw,sw,ne,sw,nw,sw,sw,nw,sw,ne,ne,sw,se,se,sw,sw,sw,sw,sw,n,n,sw,nw,n,sw,sw,n,se,sw,sw,sw,sw,sw,sw,sw,sw,sw,se,sw,ne,sw,n,sw,sw,s,nw,s,s,sw,sw,sw,s,sw,sw,sw,ne,nw,s,sw,s,sw,s,ne,s,ne,sw,sw,sw,s,sw,s,sw,s,s,sw,sw,sw,n,sw,s,sw,sw,s,sw,sw,sw,sw,s,sw,sw,sw,se,sw,ne,sw,sw,se,sw,sw,sw,sw,s,s,s,s,sw,s,s,sw,sw,s,nw,n,s,s,sw,s,s,n,se,s,sw,sw,se,se,s,s,sw,sw,nw,s,nw,s,s,s,s,s,s,sw,sw,s,s,s,n,sw,s,sw,s,s,s,s,s,n,s,se,s,ne,ne,s,s,ne,s,s,sw,s,s,s,s,s,s,se,s,n,s,s,s,s,s,se,s,se,s,se,ne,s,s,s,sw,se,se,se,s,s,se,nw,s,s,s,sw,se,s,s,se,s,ne,s,s,se,s,s,s,s,s,s,s,se,se,nw,s,s,se,n,s,se,ne,s,s,s,ne,s,se,nw,s,s,s,s,n,ne,s,se,se,s,s,ne,s,sw,s,s,s,se,s,s,s,se,ne,s,s,s,s,se,s,s,s,se,s,s,s,se,s,s,nw,s,s,nw,s,se,sw,s,s,se,s,s,se,se,s,se,se,s,s,se,sw,se,se,se,se,se,s,s,s,s,se,se,ne,se,s,ne,nw,se,se,s,se,nw,se,se,n,se,s,n,se,n,s,se,se,se,sw,ne,se,se,s,n,s,se,se,se,s,se,s,se,n,se,se,sw,se,se,s,nw,sw,se,nw,se,se,se,se,s,se,se,se,se,se,se,se,se,se,se,n,s,se,se,se,se,ne,nw,se,se,nw,se,se,n,s,se,se,se,s,se,se,se,se,se,se,ne,se,se,ne,se,se,nw,se,ne,se,se,se,se,s,se,ne,se,se,se,ne,se,nw,ne,se,s,se,se,se,se,se,nw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se,nw,ne,s,s,s,se,s,se,se,s,se,se,s,se,s,se,s,nw,s,sw,nw,s,s,s,s,s,s,s,sw,se,se,s,s,s,s,s,sw,se,se,s,s,se,nw,ne,s,s,s,s,s,s,s,s,s,se,n,se,s,s,n,se,se,se,s,s,s,s,ne,se,s,s,s,s,s,sw,s,s,sw,s,s,s,s,s,sw,se,s,s,se,se,se,se,s,s,s,s,sw,s,nw,sw,s,se,nw,se,s,se,s,s,se,se,s,s,s,se,sw,n,nw,se,s,se,s,se,se,s,se,s,se,ne,s,s,s,s,s,s,se,se,se,s,s,sw,s,se,s,s,s,s,se,s,se,se,se,s,se,se,n,s,s,se,se,s,se,s,s,sw,s,se,s,se,s,se,s,se,se,se,se,sw,s,s,se,se,se,s,s,sw,s,s,ne,se,nw,s,s,s,s,s,s,s,nw,se,s,se,s,s,s,se,nw,se,s,ne,s,s,nw,s,s,sw,s,s,se,s,se,s,s,s,n,se,se,se,se,s,s,sw,s,se,s,s,n,s,s,s,se,s,s,se,s,s,ne,se,se,se,se,se,se,se,s,s,se,se,s,se,se,se,s,s,s,se,s,s,se,ne,se,s,s,se,s,se,s,se,se,s,se,s,se,se,se,n,s,sw,s,ne,se,se,se,ne,se,s,s,se,s,se,s,se,sw,se,se,s,se,s,s,s,s,s,s,s,s,se,s,s,s,se,se,se,s,se,nw,se,n,se,se,se,se,s,se,n,s,s,s,se,s,s,se,s,ne,s,se,se,se,s,s,se,se,s,s,s,se,s,n,sw,s,s,s,ne,s,se,s,s,s,s,nw,se,s,s,s,se,sw,s,ne,s,se,se,se,s,se,se,s,se,se,s,ne,s,s,s,se,nw,nw,nw,ne,s,se,se,ne,se,se,se,se,n,ne,se,s,s,se,s,se,se,se,se,se,s,se,s,s,se,s,se,se,s,se,se,s,se,sw,s,sw,s,se,se,se,se,ne,se,se,se,se,se,se,n,se,sw,se,se,se,sw,s,n,s,nw,s,sw,sw,se,se,s,ne,se,se,se,se,ne,s,se,s,se,se,se,sw,se,se,se,s,se,s,se,nw,se,se,se,se,s,se,s,se,se,se,se,ne,se,se,s,s,se,s,se,se,s,nw,se,s,se,se,se,s,se,sw,nw,sw,se,s,s,ne,sw,se,se,nw,s,se,se,sw,s,s,se,s,s,s,se,se,n,n,se,se,s,se,nw,se,s,nw,se,se,s,ne,s,se,se,s,s,se,s,s,ne,se,se,se,se,nw,nw,nw,ne,se,ne,se,sw,se,n,se,s,s,se,s,s,se,s,n,se,se,se,se,se,se,s,se,nw,sw,se,se,se,se,s,s,s,ne,s,se,se,se,s,se,s,se,ne,sw,se,n,se,se,se,se,se,s,se,s,se,s,s,nw,s,se,se,se,se,se,s,nw,se,s,se,s,se,se,s,se,se,n,s,s,se,se,sw,se,s,ne,s,se,se,ne,ne,se,se,se,se,s,se,se,se,se,se,s,se,s,nw,se,sw,s,sw,nw,ne,s,se,s,s,s,se,se,se,se,se,ne,n,se,se,nw,se,se,s,se,se,se,se,se,se,se,s,se,se,se,ne,se,s,nw,se,se,nw,ne,nw,s,se,se,se,se,s,se,s,nw,se,sw,nw,se,s,s,se,se,se,se,se,n,s,se,se,s,se,nw,se,se,s,se,se,s,se,se,se,se,s,se,se,se,s,se,ne,se,se,se,se,se,se,se,se,s,se,nw,s,n,ne,se,s,se,sw,se,se,se,s,ne,n,se,se,se,ne,se,nw,se,ne,ne,se,se,se,se,se,se,se,n,se,se,se,se,se,s,se,n,se,se,se,se,n,se,se,n,se,ne,se,nw,se,se,se,se,se,s,nw,se,s,se,s,s,se,se,se,sw,s,se,se,se,se,nw,s,sw,se,se,nw,se,se,se,se,se,s,se,se,se,se,ne,se,nw,se,sw,sw,ne,se,se,n,nw,sw,sw,nw,se,s,n,se,se,se,sw,se,sw,s,se,sw,se,ne,se,se,s,se,se,se,se,nw,se,se,se,se,se,se,se,ne,sw,se,nw,se,se,se,se,s,s,se,se,n,nw,se,nw,se,se,se,ne,se,se,se,se,se,nw,se,se,se,se,n,se,se,se,se,s,se,n,se,s,s,se,se,se,se,sw,ne,se,se,se,sw,s,se,se,se,se,se,se,se,se,se,se,se,sw,se,se,s,se,s,sw,se,se,se,se,se,se,sw,se,se,se,se,se,se,se,se,se,se,s,se,s,se,se,se,sw,se,se,se,se,nw,se,se,sw,se,nw,se,se,se,s,se,se,se,se,se,se,se,se,s,se,ne,se,se,se,se,sw,se,se,se,ne,se,se,se,sw,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,nw,se,se,se,se,se,n,se,se,se,s,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,sw,se,se,se,se,se,se,s,se,ne,se,se,se,n,s,sw,sw,sw,nw,nw,nw,nw,nw,n,n,ne,n,n,n,ne,ne,n,ne,n,ne,ne,se,se,n,se,se,se,ne,se,se,se,sw,se,se,se,se,nw,se,se,se,se,se,se,s,n,se,s,s,s,n,s,s,n,s,se,se,n,s,s,s,ne,s,se,ne,ne,s,sw,s,s,s,s,sw,se,s,sw,sw,se,sw,nw,sw,s,s,sw,sw,sw,s,sw,sw,sw,sw,sw,ne,sw,s,sw,sw,sw,s,sw,n,sw,sw,se,sw,sw,sw,n,sw,nw,nw,nw,sw,sw,sw,nw,se,nw,nw,nw,se,sw,sw,nw,nw,sw,nw,nw,nw,nw,sw,se,nw,nw,sw,ne,nw,nw,nw,nw,nw,n,nw,nw,nw,ne,nw,s,sw,nw,nw,n,ne,nw,nw,sw,nw,nw,nw,n,n,se,s,ne,nw,sw,nw,s,n,nw,s,nw,n,nw,n,sw,n,n,nw,n,nw,n,n,n,n,n,n,n,n,nw,n,n,nw,n,n,n,n,n,sw,n,n,nw,n,ne,s,n,n,n,se,n,sw,n,nw,n,n,sw,n,n,nw,sw,se,se,n,n,n,n,n,n,s,ne,n,n,n,ne,nw,nw,n,n,nw,n,ne,s,nw,n,n,ne,n,n,ne,se,n,n,nw,ne,n,n,n,ne,nw,n,n,ne,n,nw,ne,n,ne,n,ne,nw,ne,se,ne,n,sw,ne,ne,ne,n,ne,n,ne,n,sw,ne,ne,ne,nw,ne,nw,n,nw,ne,ne,ne,n,ne,se,ne,s,ne,nw,n,n,ne,s,ne,ne,s,s,ne,nw,ne,n,ne,ne,ne,ne,nw,ne,ne,ne,ne,ne,se,ne,ne,s,ne,sw,ne,ne,ne,se,ne,ne,ne,n,n,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,se,se,ne,ne,ne,se,sw,ne,ne,nw,se,ne,se,ne,ne,se,ne,s,se,ne,sw,ne,ne,se,se,se,se,ne,se,se,se,ne,se,nw,se,se,ne,n,ne,se,se,n,s,ne,ne,se,se,se,ne,ne,se,ne,ne,se,se,s,ne,se,s,ne,ne,ne,s,se,se,s,ne,se,n,ne,se,ne,se,se,ne,se,s,se,ne,se,se,ne,ne,se,ne,se,ne,se,nw,se,s,ne,ne,se,se,ne,nw,se,ne,se,se,se,se,n,se,ne,se,se,se,nw,se,se,se,s,se,se,se,se,se,se,se,se,se,sw,se,ne,se,n,se,se,s,s,se,se,se,se,se,se,sw,s,se,ne,se,s,se,se,se,se,se,se,se,se,s,s,se,se,se,se,nw,se,se,se,se,se,se,nw,ne,s,ne,se,se,nw,s,se,se,se,se,s,sw,s,ne,n,se,s,se,se,s,se,s,s,se,nw,sw,s,s,se,se,se,sw,se,se,s,se,ne,se,se,se,n,s,s,s,s,ne,n,s,se,s,nw,se,se,s,se,se,s,s,s,s,n,s,nw,n,se,se,s,s,se,se,s,se,s,s,se,s,s,se,s,s,se,s,s,s,n,se,ne,nw,s,se,s,nw,n,se,s,se,n,s,ne,s,nw,s,s,s,s,s,se,nw,s,s,se,ne,s,se,s,s,se,s,ne,se,s,se,s,s,se,s,s,se,s,ne,se,s,n,se,nw,s,s,s,se,s,s,s,n,s,s,s,s,s,s,s,s,s,s,s,s,nw,s,s,s,se,s,s,s,s,n,ne,s,s,s,s,nw,s,s,sw,s,s,s,n,sw,s,s,s,s,s,s,s,s,s,ne,s,s,nw,sw,s,nw,s,s,s,s,s,s,s,se,nw,s,s,s,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ne,ne,ne,s,ne,ne,ne,ne,ne,ne,ne,ne,se,se,ne,ne,ne,s,ne,n,ne,s,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,s,ne,ne,ne,ne,s,se,ne,nw,ne,sw,se,ne,ne,se + diff --git a/2017/ruby/day_11.rb b/2017/ruby/day_11.rb new file mode 100644 index 0000000..8b56f80 --- /dev/null +++ b/2017/ruby/day_11.rb @@ -0,0 +1,26 @@ +dirs = ARGF.read.strip.split(?,) +current = [0, 0, 0] +max = 0 +dirs.each do |dir| + delta = case dir + when "nw" + [-1, 1, 0] + when "n" + [0, 1, -1] + when "ne" + [1, 0, -1] + when "sw" + [-1, 0, 1] + when "s" + [0, -1, 1] + when "se" + [1, -1, 0] + else + raise "omg!" + end + current = current.zip(delta).map {|a,b| a + b } + max = [max, current.map(&:abs).sum / 2].max +end +p current +p current.map(&:abs).sum / 2 +p max