AoC 2021 D13: Transparent Origami
| Problem statement | Source code | Tags: GeometryManual inspection
← Previous Back to AoC Index Next →
Part 1
I represent the points as a list of coordinates. A fold along transforms to:
A fold along is similar:
Unfortunately again, JavaScript doesn't have composite keys for sets, so to deduplicate points after folding, I serialize each point as a string x,y and store them in a set.
Part 2
Just apply all folds in sequence, and plot the resulting points. Like every time, I take some time to admire the ASCII art.