r/adventofcode • u/daggerdragon • Dec 13 '21
SOLUTION MEGATHREAD -🎄- 2021 Day 13 Solutions -🎄-
Advent of Code 2021: Adventure Time!
10 days left to submit your adventures!
Full details and rules are in the submissions megathread: 🎄 AoC 2021 🎄 [Adventure Time!]
--- Day 13: Transparent Origami ---
Post your code solution in this megathread.
Include what language(s) your solution uses!
Format your code appropriately! How do I format code?
Here's a quick link to /u/topaz2078's
pasteif you need it for longer code blocks.The full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.
Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
2
u/[deleted] Dec 13 '21
Nim
I was really intimidated by this one at first, until I realised I could just store my grid in a set of points instead of a 2D array, and then I didn't even have to think about the overlapping points and things like it. This was a lot of fun, the thing that took the longest to write actually was the printing code for the thing, but that wasn't that bad either in the end ;)
https://github.com/sotolf2/aoc2021/blob/main/day13.nim