diff --git a/ruby/day_18.rb b/ruby/day_18.rb index f5e58ef..0be0b52 100644 --- a/ruby/day_18.rb +++ b/ruby/day_18.rb @@ -5,6 +5,10 @@ class Grid < Struct.new(:state) neighbors = self.neighbors(x,y).count(?#) (light == ?#) ? (([2,3].include?(neighbors)) ? ?# : ?.) : ((neighbors == 3) ? ?# : ?. ) }} + state_[0][0] = ?# + state_[0][99] = ?# + state_[99][0] = ?# + state_[99][99] = ?# Grid.new(state_) end