Advent of Code

I’ve been working on the Advent of Code challenges this year (big thanks to Eric Wastl for putting that together). It’s been a lot of fun.

Every day he posts two new Christmas themed challenges. The challenges are pitched as being for all skill levels, and I’ve definitely found some of them to be more time consuming than others.

The first few were fairly straight forward string processing, but some later challenges were more complicated: they probably could have been solved with a well crafted regex, but I opted for a custom State-Machine based parser. Some could be solved fairly iteratively, and some were prime opportunities to try a little recursion. It’s been great to stretch my mind trying to solve problems that are quite a bit different than my day-to-day.

I’ll probably update this post with commentary on some of my solutions, which are available on GitHub.

The projects pose a good chance to synthesize a bunch of skills and develop new knowledge of C# and some of the community libraries. So far I’ve used:

  • xUnit.NET
  • NFluent
  • Recursively processing JSON using JSON.NET
  • Build a graph to solve traveling salesman
  • Build a graph to solve a virtual circuit
  • State machines for escaping and unescaping strings

Looking forward to the rest of Advent of Code!