Skip to content

The Advent of Code 2021 Day 16, Technical K.O.

Posted in Advent of Code

Hello everyone, it’s time for your Advent of Code 2021 Day 16 cruise log. Today has been a rough day, bidding farewell to the girlfriend as she joins her parents for the Christmas season. This is fine, we’ll join again before switching years but waking at 4 am to do so did leave a mark.

After waking, I stretched and played some FIFA since after saying goodbye, for now, I only had about ten minutes before the first challenge. I lost that FIFA game and it was the first of many disillusions today.

The problem didn’t feel particularly hard, actually, I believed I would make quick work of it before sunrise. And yet, it is the most challenged I felt in a bit, maybe because I failed to parse the problem correctly. Maybe it is the lack of coffee but I did struggle to get a few tests working.

Only got 2 me-generated samples + First sum sample right

Still, after these, I found quite the dirty hack to get the fourth example passing. It felt like I was getting there.

Managed to get the second example sum working but still, 3 don’t

I feel like I’m getting closer as tests grow greener but still not there, with some debugging I do realise that the top has the right version. From the problem description, I should hit the literal packet four times but only do so once. From there I decided to take a break so that I could relax before starting work.

A few hours later, at lunchtime, following a very busy morning working, I got back to the problem and decided to go from the closest failing result and try to work my way up from there. The seventh test returns everything except the last literal value. There must be something there that will help me solve this.

I notice through debugging that the code never adds the final value of the last packet, but could potentially hack through to force that happening. And now the 7th test passes with a less filthy hack than I used for the 4th test. Even better, I could remove the 4th case hack and it still worked.

Now there are two tests left, values are increasing so the code parses more packets but not enough. After further uncommitted fiddling, I lost my code and decided to have food instead. Looks like I will nuke this and go back from scratch after work.

However, after another hour of looking at this, the tiredness got to me. I cannot think clearly enough to resolve this thing. Each step forward feels like ten steps back. Even worse, since I do not commit code for these challenges until done I even had to restart some of it after some IntelliJ shenanigans lost me part of the implementation.

It is time for me to bow out of this one and maybe I will take another stab at it over the weekend or maybe tomorrow if day 17 doesn’t dunk on me as hard.

Thank you for reading my Advent of Code 2021 Day 16 log, I will see you tomorrow. Unfortunately, for the first time in forever, I will not push the code on the challenge’s day on Github. Feel free to check out my Day 15 log right here. I will make sure to share it with you guys when I get back on today’s challenge.

Photo by MART PRODUCTION from Pexels

Be First to Comment

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    %d bloggers like this: