Advent of Code — 2020

Halit Dönmez
2 min readJan 21, 2021

I finished Advent of Code 2020 (AoC) and just wanted to share the experience. This was my first time getting acquainted with this and I gotta say; I really loved it and wanted to share some thoughts

Submission System

Each coding challenge I solve involves some submission system. You write the code, push some button to submit and then you get a result saying you passed or failed. It is not the best way to do things in my opinion and quite possibly and it may not represent real world situation you may face.

Advent of Code was a breath of fresh air. You get an input, then you need to write down your answer as output. That’s it. No online submission, no extra process. Choose what you want and then find the answer. It was amazing to say the least 😃

No more worrying about connection, how to read the input, trying to decrypt some error messages that has nothing to do with your submission etc. Honestly, more sites should do this 😃

Challenge Highlights

Since I could choose whatever language or means, I had the option to use different tools for the problems. Below is an example I remember from the experience.

  1. Day 19 — Monster Messages:
    This challenge (seen here https://adventofcode.com/2020/day/19 ) was about rule matching. I have considered several approaches but they were taking too long time to do.
    Instead I remembered that one can create a set of rules and write a yacc file. Essentially, lex and yacc can be used to create and compile a grammar which has certain set of rules. See here http://dinosaur.compilertools.net/
    What this meant for me was that I did not had to bother with writing recursive programs, come up with optimized approaches. All I had to do is to input the rules and see how many input strings would match.
    This was a huge time saver. See the code here: https://github.com/halitanildonmez/CodingPractices/tree/master/lex_yacc_test

Final Word

This was really fun to do. A different approach to coding challenges which not only pushes you, but also forces you to think outside the box because now you have your whole computer and programming languages as a tool.

Here was the resulting map for me:

--

--