Visualisation of AOC 2022 Day 14
Today’s Advent of Code problem was more visualisation-bait. The problem set was to first decode a (vertical) map of rocks, and then to determine how sand falls through that landscape; part 1 stops as soon as sand “hits the floor” (although the condition was stated a little differently…). Part 2 had the code continue until the floor “fills up” and propagates back to the entry point.
My map decoded to:
And after I ran all the sand through it, it looked like:
And, naturally, this makes for a nice animation of sandfall:
The code used to generate these visualisations is here: aoc2022/go/day14part12visualisation.go