Point in polygon - Day 10 - Advent of Code
Join me to solve Day 10 of Advent of Code 2023 - The Pipe Maze - in Ruby!
In this coding challenge, we'll navigate a grid map of different pipe connections to:
Parse the input grid data
Find starting points and valid neighbors
Traverse around the pipe loop to map its path
Determine enclosed tiles inside the loop
Use raycasting logic to count wall intersections
Handle tricky cases like squeezed openings
The solution builds a search to map out the full pipe structure. We'll refine the directional rules and fix bugs in the graph traversal logic.
Mapping polygons and counting enclosed regions employs some novel techniques like raycasting and parity checks.
Advent of Code: https://adventofcode.com/
My Solutions: https://gist.github.com/cjavdev/d15a2a4ffed6c840c2fb28a093e9f927/
Playlist https://www.youtube.com/playlist?list=PLS6F722u-R6KYlGyUv65EFpGKl2Esmurr
#adventofcode #ruby