|
|
@ -84,6 +84,7 @@ p y_range.sum {|y|
|
|
|
|
a = loop_.fetch([y, x_a], nil)
|
|
|
|
a = loop_.fetch([y, x_a], nil)
|
|
|
|
b = loop_.fetch([y, x_b], 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]))
|
|
|
|
(a.nil? && b.nil?) || (a && TILE_NEIGHBOR_DELTAS.fetch(a).include?([0,1]))
|
|
|
|
}.select {|chunk|
|
|
|
|
}.select {|chunk|
|
|
|
|
# keep empty tiles
|
|
|
|
# keep empty tiles
|
|
|
|