Advent Of Code 2023

:date: 2023-12-27 16:57 :tags:

This month I've been playing an unusual video game. This was the Advent Of Code 2023. This is a computer programming challenge where every day for the first 25 days of December there is a new puzzle. Everyone has different input conditions so everyone's answer is different. Unlike real computer programming, the puzzles are neatly defined and there is a known correct answer that you are trying to match.

aoc2023.png

Some of it was fun but, unsurprisingly, a lot of it felt like work. When I started it, I felt like it might be easy enough. I didn't think it was going to gobble up the entire month of December, but like any good game, and even some bad ones, it was strangely compelling.

At the beginning the puzzles were easy enough that I could do them quickly. This made me think that I could use my normal unix tricks to solve these, and that was often true. But as the complexity increased, getting the solution in a single unix command line started to take more time than just writing a Python program. And then as the Python programs required greater complexity, I foolishly switched over to C. Thus there was really a lot of shooting myself in the foot. It took me a while to fully realize that the problems were deceptive and becoming increasingly difficult. Adding unnecessary operational complexity with artisanal programming languages was not going to be fun. Or maybe it was going to be extra fun? Struggling to succeed at video games can be philosophically complicated.

stats.png

I was on track to complete everything but after the 18th I was traveling and skiing and hiking and doing real life things which left less time for nerd puzzles. The biggest impediment was taking a professional interest in day 17 and dragging that into a 6 day quest to get a working A* algorithm in C using dynamically allocated memory; unfortunately, although I got the algorithm I wanted, it didn't quite solve the puzzle. There were some part twos that I did actually "solve" as far as software goes, but I never found the right answer because it felt stupid to toast my computing hardware by running full power all night.

And at the end, I started to boycott problems involving a 2d grid. After a handful of these I was getting good at loading them into dynamic memory in C and dealing with it, but the puzzles just felt too grindy. Constantly having to check all the directions and then check for exceeding bounds every time anything happened was getting tedious day after day. If I were to get serious at playing this game, I would create a 2d grid "game engine" in C so that all that stuff was neatly taken care of.

Since another software game I play is writing all the software that creates this blog/website, I can cheat a bit on posting things. As I completed the challenges, I took some notes. Now I'll post these back dated so nobody has to get notifications, but interested nerds can check out highlights of the gory details. Here's a list of posts for each puzzle.

When I'm playing a game like Far Cry, I never get the feeling, "Gee, I should probably be applying all this homicidal energy to quietly ganking real humans who accessorize with the wrong color palette." But of course Advent of Code is quite different. It is more how professional lumberjacks must feel about log cutting competitions. I sometimes suspect that people who are very good at coding competitions and puzzles actually are somewhat weak when it comes to finding good applications for their skills. While I may lack the most elite abilities to quickly solve tidy coding challenges inspired by algorithms textbooks, I do not lack the imagination to apply my technical skills to actually improving my life with software. Consequently I have dozens of personal software projects in the queue and not working on them while doing this felt kind of dumb.

In my defense, programming is like any sport: while natural ability never hurts, for anyone to consider themselves "good" there must be training. You have to be in shape for it. Well, after a month of thinking about these tough little problems and writing code, I am in good form again for programming. This is especially true with C which can be hard to adapt your mind to. It was probably good that I got back into good form on some unimportant frivolity rather than letting warm up related defects creep into my real software. I'm looking forward to producing some good software in 2024!