Closing Pipes for Advent of Code 2023 - Day 10


Day 10 of Advent of Code had us trace the layout of a pipe and then determine which spaces remaining that were completely enclosed by the pipe. Once the pipe was traced and closed, an application of the even-odd rule was used to determine the enclosed spaces.

I chose a simple solution of always just casting my ray to the left. This ended up simplifying my code, as there are cases where the ray only went over parallel lines, never intersecting a truly vertical line. In this case, I only needed to consider pipes that went downward for the even-odd counting.

Advent of Code 2023 - Day 10