08 Dec 2016 - by 'Maurits van der Schee'
Every day in December I am doing a programming puzzle. The series is called Advent of Code and it follows the advent calendar approach. Every day from the 1st until the 25th of December one puzzle is unlocked. The puzzles get gradually harder and each puzzle has two parts, where the first part is easier than the second.
There is a leaderboard allowing you to compare yourself with other programmers. A nice 100 points are awarded to the person that solves the puzzle first and 90 to the tenth 80 to the 20th. If you don't hit the top 100, then you can still see your rank, but you will receive 0 points. Another complicating factor is that the puzzles become available at midnight in New York (EST time). I have to get up at 6:00 in the morning to compete, not fair! Nevertheless I was proud to score 58th on the 5th of December when I actually got up early to try.
Although I can program in a dozen of languages, I decided to solve the puzzles in PHP, as I feel very comfortable in that language, which is important when attempting a speed record. Typically these puzzles take me 5 to 30 minutes to solve, which is typically the amount of time that you can make free on any given day for something as fun as this. Some of my colleagues are attending as well and therefor I publish my solutions on my Github account (so I can get some feedback). We even registered for a private leaderboard on the site, so that we can see whether or not everybody has solved a given puzzle.
Last year's puzzles are available as well! And although you can no longer hit the leaderboard, you can still track your progress. I decided to solve last year's problems in Go. I love the Go language for being somewhere in between C and Java in many aspects. The biggest advantage of doing last year's puzzles is that you can just keep going and do not have to wait 24 hours for the next puzzle to become available. I encountered one particularly hard puzzle in last year's series: 19 part 2. I eventually solved it, but still don't quite understand why the solution is correct. These solutions are also published on my Github account for future reference.
Eric Wastl is the creator of Advent of Code. He also made Vanilla JS, PHP Sadness, and lots of other things. These other projects are also worth checking out! You can follow him on Twitter and Github.
PS: Liked this article? Please share it on Facebook, Twitter or LinkedIn.