diff --git a/2023/ruby/day_10.rb b/2023/ruby/day_10.rb index ec848d8..09918ca 100644 --- a/2023/ruby/day_10.rb +++ b/2023/ruby/day_10.rb @@ -84,6 +84,7 @@ p y_range.sum {|y| a = loop_.fetch([y, x_a], nil) b = loop_.fetch([y, x_b], nil) + # it's a chunk if it's multiple empty tiles or a pipe that goes east (a.nil? && b.nil?) || (a && TILE_NEIGHBOR_DELTAS.fetch(a).include?([0,1])) }.select {|chunk| # keep empty tiles