Advent Of Code - A field report
Advent Of Code Calender

Advent Of Code - A field report

I am proud to have participated in a deep water submarine rescue mission, helping to find elf keys to save Christmas.

How it is designed

No I am not crazy, I am of course talking about: Advent Of Code

Here programming puzzles integrated into a funny story are published every day. The story is a very good motivator. At the beginning the problems are relatively harmless, but as the days go by they become more and more difficult.

Each day consists of a puzzle, which is divided into two parts. The first one gives a silver star, the second one a gold star. If you have solved the first part, you have laid the foundations for the second part.

For example, at the beginning you have to check how many times a reduction occurs in a sequence of numbers. Later, you have to program a mini-processor instruction set and find out with which inputs a maximum result would have come out. Or a kind of AI to find a strategy to bring Amphipoda home with as little energy as possible. 

The whole thing is designed as a game against time. The faster you can solve the problems, the more points you get. The puzzles are always published at 6am (CET) (Midnight EST). 

The puzzles get trickier and trickier. With naive recursions only the first problems can be solved, but at some point it is mandatory to use dynamic programming and/or pruning skillfully.

In the following chart you can see, that the further it goes, the less people reached a gold star.

From the statistics you can see how many stars have been achieved per day.

How I played

I took a more relaxed approach and decided to use a broad range of programming languages and technologies.

So I implemented in a pathfinding problem with vanilla JavaScript and built my own heap data structure (aka priority queue). Honestly, when do you do something like that after the first few semesters in college? Btw: it is absolutely necessary to use a heap when path finding, as you very often have to find the minimum in a set and linear scanning would end in a gigantic runtime.

Other highlights for me were playing with Nvidia CUDA and OpenGL to solve problems on the graphics card instead of the CPU. Of course, that's not the fastest way to get there but definitely one with style.

I also used the AoC to do some functional programming again (F# and Haskell (uff)). But also very old programming languages, like Fortran or Ada and relatively new ones, like Dart and TypeScript.

You can see all my solutions here on: GitHub

Conclusion

I really enjoyed procuring myself with different technologies. While participating, I couldn't wait to see how the story continues and is definitely worth a look.

I can only recommend the AoC. No matter if you are a professional, a hobbyist or a beginner. 

To view or add a comment, sign in

Others also viewed

Explore content categories