Shoelace, Pick, and Enumerators - Day 18 - Advent of Code 2023

In this Advent of Code 2023 video, you’ll learn how to solve the "Lava Duct Lagoon" puzzle from Day 18. We walk through calculating the area of a complex polygon shape based on a set of digging instructions.

The key techniques and concepts covered are:
- Parsing direction, step count, and color instructions
- Visualizing the polygon by drawing it on a grid
- Applying the Shoelace Formula to calculate interior area
- Using Pick's Theorem to count interior dots
- Switching to an Enumerator/Generator for better performance
- Yielding instructions instead of materializing a huge array
- Keeping a wall-length counter to enable Pick's Theorem

We’ll start with the sample input, walking through the instructions visually, then extend it to handle the full input efficiently using enumerators.

Shoelace Formula
Pick's theorem

Advent of Code:
My Solutions:

#adventofcode #ruby