Skip to content

The Advent of Code 2020 Day 15 log, Counts and turns

Posted in Advent of Code

Hello, there and welcome to my Advent of Code 2020 Day 15 cruise log. For the first time since day 9, I went through my fastest completion since Day 6. Today’s problem got the storyline back in the North pole, basically, our character is bored and checks in with the elves. The elves then share the rules of some memory game and this is where the problem starts.

The first part felt tricky, while I wrote the bulk of the code fairly fast, the details of the rules caught me off guard. My original test run fails even though I am certain that my code meets all the requirements. Well, not quite, as it turns out, one of the rules given was kind of obfuscated by my waking up at 4 am. Not only that but the third rule overwrites the second for any number an elve would speak more than once.

Upon realising that, I could then fix my code in little to no time and also very little test. I only wrote a test for parsing the input and another one for the whole first part. The necessary and sufficient choice if you ask me. From there, I ran the program against my input and got the right result.

Now for the second part, I see that all I need to do is proceed to the same calculations as the first. However, I must give a value at a further index, the 30000000th instead of the 2020th. This felt too easy so I got suspicious, I looked for a trap. Through five long, paranoid minute I could not find a trick nor trap waiting for me. From there I choose to jump into it and try to work it out if it fails. But surprisingly, it doesn’t. No trap, no trick, and a finish in under 43 minutes and a ranking as 2941th. My best ranking this year for a gold star. Or any star for that matter. Short and sweet which gives me plenty time before working out to debug why my scale says I lost 10% body fat overnight which definitely didn’t happen.

Thank you for reading my Advent of Code 2020 Day 15 cruise log, I will see you tomorrow, maybe. In the meantime, you can check out my Go Cloud series about building and deploying a Golang app to AWS. Also, I will push my code on Github at CodingNagger/advent-of-code-2020 so feel free to check it out but not before you’ve done the challenge yourself. Bye!

Photo by Magda Ehlers 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: