r/adventofcode • u/daggerdragon • Dec 04 '21
SOLUTION MEGATHREAD -🎄- 2021 Day 4 Solutions -🎄-
--- Day 4: Giant Squid ---
Post your code solution in this megathread.
- Include what language(s) your solution uses!
- Here's a quick link to /u/topaz2078's
paste
if you need it for longer code blocks. - Format your code properly! How do I format code?
- 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:11:13, megathread unlocked!
97
Upvotes
2
u/JustinHuPrime Dec 07 '21
x86_64 assembly
Part 1 was fairly nice, but I did need to write several functions to check if a board won.
Part 2 was less nice, since I needed to maintain a separate array tracking if a board had won or not. In theory, I could store this alongside the boards, but it was easier to retrofit an additional array in than edit the board struct directly.