Day 14: Regolith Reservoir
Day 14 involves simulating falling sand in a cave system with rock formations.
Problem Overview
You're mapping out a cave with rock structures and need to simulate how sand will fall and accumulate. The key elements are:
- Rock formations are represented as lines in the input
- Sand falls from a specific source point (500, 0)
- Each sand unit follows specific movement rules until it comes to rest or falls into the abyss
- For Part 1, you need to count how many sand units come to rest before sand starts falling into the abyss
- For Part 2, a floor is added, and you need to count how many sand units it takes to block the source
This problem tests your ability to simulate physical processes and handle grid-based representations of a 2D space.
Navigation
- Problem Description: Detailed description of the day's challenge
- Solution Explanation: Walkthrough of the approach used
- Code: The complete implementation with comments