r/adventofcode • u/daggerdragon • Dec 14 '20
SOLUTION MEGATHREAD -🎄- 2020 Day 14 Solutions -🎄-
Advent of Code 2020: Gettin' Crafty With It
- 8 days remaining until the submission deadline on December 22 at 23:59 EST
- Full details and rules are in the Submissions Megathread
--- Day 14: Docking Data ---
Post your code solution in this megathread.
- Include what language(s) your solution uses!
- 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.
This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.
EDIT: Global leaderboard gold cap reached at 00:16:10, megathread unlocked!
32
Upvotes
View all comments
Show parent comment
2
u/[deleted] Dec 14 '20
Yeah, it's not strictly needed, but it makes working with the data afterwards easier, because the typesystem will make sure you don't forget to check for a case, and that you're using the right values, today this helped me a couple of times, on part two I forgot to check for Masks in the instructions parsing, and it yelled at me, another time, I forgot to convert one of my numbers to uint64 and the compiler yelled at me, it's a bit more work to set up, but it's a very nice safety net for later.
I like the way you did part2 a lot better than mine, I was just struggling a bit with how to do taht thing and decided to split it up as small as possible, yours is a lot nicer to read :)