Advent of Code

Solving puzzles with code
puzzles
Author

Jesse van Elteren

Published

July 10, 2021

aoc

Remember these 🎅Advent Calenders🎅 where you open a door each day to find a piece of candy? Advent of Code is like that, but with coding puzzles: from 1st to 25th of December, every day a puzzle unlocks at midnight. Each puzzle has two parts where you can earn a star, so you can earn 2 stars per day, adding up to a total of 50. Since 2015 every year the amount of particpants grows, in 2020 over 150.000 people around the world have participated. You can solve the puzzles any way you like. I’ve always used Python, but anything goes, even Excel (if you are brave).

I was introduced to AoC in 2018. It was a real challenge🤯 to solve all the puzzles. In 2020 I tried to compete for the leaderboard, which meant getting up at 5:50AM 25 times in a row, which was an experience in itself. Never did I get a spot in the top 100, but I am proud to be part of the ~700 people who finished all the puzzles from 2015 onwards.

For old times sake, I’ve listed my personal Top 9 most memorable puzzles of all time (2015-2020):

9) 2019 Day 23: Category Six

A nice puzzle where you had to simulate computers💻 receiving and sending packets over a network to eachother. Memorable because I later could use it to practice using Python🐍 Async.

8) 2018 Day 23: Experimental Emergency Teleportation

Given a 3D room with many bots that can reach up to a certain distance, what’s the spot where you can reach most bots? Seems simple, but the room is HUGE! This makes solving the puzzle a nice challenge.

7) 2019 Day 13: Care Package

2019 is a special year for AoC, since you eventually code your own working ‘IntComputer’. During day 13, we used this computer to play arkanoid. Later on there were more puzzles where the IntComputer was used.

6) 2020 Day 21: Allergen Assessment

For many people probably not very memorable, but this got me the 189th spot on the leaderboard💯, where I normally hovered around 1600. Usage of sets in Python just came together for me in this one.

5) 2019 Day 18: Many-Worlds Interpretation

Memorable because it was very difficult to solve with code and did it eventually on paper! You’re in a maze and need collect keys🗝. The keys correspond to doors that open when you find the key. The mechanism of unlocking doors makes the amount of possible states explode.

4) 2018 Day 17: Reservoir Research

Another one from my first year of participation. You have to simulate water🌊 falling down into buckets. Just a great puzzle to toy around with. All AoC puzzles have some kind of story to them. I found this one to be especially memorable.

3) 2016 Day 11: Radioisotope Thermoelectric Generators

Remember that puzzle of the wolf🐺, chicken🐔 and farmer👨‍🌾 that have a boat to cross the river? That’s the one, but now with 5 animals and 3 rivers. I played with lego blocks trying to find the best solution. Didn’t work, got confused and in the end had to make it into a BFS, which is an algorithm that comes around frequently in AoC.

2) 2018 Day 10: The Stars Align

A puzzle where you are presented with a set of stars🌟 that are moving towards eachother. Again a simulation where at a certain point of time the stars align into a code. Animating the stars and having to zoom in into that tiny spot where they formed the code was lots of fun.

1) 2019 Day 22: Slam Shuffle

And the number one, the only puzzle in 2019 I didn’t solve in the same day. Take a deck of cards🗃, apply some operations on it and identify the card in postion 2020. Easy enough right? Yes, untill for part 2 that deck consists of 119315717514047 cards and you have to apply the operations 101741582076661 times! Good luck brute forcing that. It took me around 20 hours to solve the puzzle and was so close to giving up. Such a great feeling when it finally came together. Wrote a small post on reddit on it.

I’ve uploaded my solutions to GitHub. People post their solutions on the AoC subreddit, which is a great way to learn from the best.

Needless to say I highly recommend AoC! See you all December 1st🎄!