everybody.codes
I’m a huge fan of coding puzzles. I’m not really good at them, but I enjoy doing them, especially live or as VOD to show off my smooth brain. If you want to join me, those links lead you to my Twitch and YouTube, but they are mostly in German.
The end of the year is always fun because, in the last 9 years, there was Advent of Code from the 1st of December to the 25th of December. And since last year, there is another event in November called everybody.codes.
Sadly, there are no events like this during summer (idea: maybe we should create Summer of Code or something). But this makes the end of the year also much more exciting.
I’m currently solving the problems in Common Lisp, but one of my viewers requested a bit of OCaml, and maybe we’ll do the next week in OCaml. Which probably results in my chances of hitting the top 100 dropping to a very low percentage. Which is fine, because solving those things is even more fun if you learn something.
So my idea is to talk a bit about my experience with the everybody.codes puzzles from this year. I’ll try to make those write-ups weekly because everybody.codes gives us a break on the weekend.
Quest 1: Whispers in the Shell#
The first quest was quite easy. We solved it as naively as possible. It basically just required us to move a pointer to a list element around, using different techniques like modulo calculations or swapping list elements. It was a really smooth start to the challenge.
Quest 2: From Complex to Clarity#
This quest introduced complex numbers, which wasn’t that bad either. We implemented all the complex number calculations ourselves, although Common Lisp has complex numbers baked into the language itself. This was a bit of a fail, but it was fun to do.
Quest 3: The Deepest Fit#
This was the first one with a twist. We had to find out how to nest boxes inside other boxes. You could actually simulate all the stuff that was happening in the problem description, but it turns out that this problem could easily be solved by a combination of filtering, sorting, and counting the elements of the list. This was the first time I ever had the feeling that my experience in competitive programming problems actually helped me solve a problem. :D
Quest 4: Teeth of the Wind#
This one was a good one as well. We had to calculate ratios between numbers and multiply and divide them accordingly. A problem that could have turned up for people is that floating-point multiplications always introduce rounding errors and other quirky stuff, but Common Lisp handles those numbers as fractions, and therefore calculations were precise, which made the problem quite easy.
Quest 5: Fishbone Order#
My nemesis question for now. The difference between the fastest human solution of around 8 minutes and my solution with about 3 hours tells a lot. I somehow was hellbent on using a self-created recursive data structure, which turned out to be an implementation of a singly linked list that can only contain 3-tuples. This implementation introduced bugs that were hard to find and debug and cost me at least 2 hours of work. Remember, everyone: don’t try to look smart by being stupid. :D If you have the data structure down, this problem was really straightforward to solve.
Conclusion Week 1#
The first week was huge fun, and none of the problems felt stupidly overtuned. The only one that felt hard for me was quest 5, but that’s because I am a huge dum-dum.