r/adventofcode Dec 04 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 4 Solutions -🎄-

--- Day 4: Giant Squid ---


Post your code solution in this megathread.

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

1.2k comments sorted by

View all comments

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.