Welcome!
The source code of this application is available on GitLab.
What is this?
This is a solver for the problems from Advent of Code 2020. If you haven’t heard about Advent of Code yet, you may want to read the official about page first.
Choose any day from the navigation menu, and you will be able to find the link to official problem description, run the solver with my input data (or enter your own input), and see my C# solution.
Every participant is given their own, randomly generated problem inputs. The solver gives correct answers for my inputs; I also tested it against the inputs from some people who kindly shared their own inputs and answers. It is entirely possible that I missed some edge cases.
The explanations of each solution assume that the reader is familiar with the task (i.e. at least read the problem statement from the official AoC website, and spent a few minutes on thinking how to solve it). They are unfortunately not stand-alone, and probably worthless without appropriate context. 😑
Why?
I wrote this app mainly for two things:
- To refresh my C# knowledge.
- To learn a little about developing web applications with Blazor WASM.
Lessons learned
WASM does not play nice with frequent memory allocation. There seems to be a big overhead compared to the same code running as a console app. Deep recursive calls will promptly crash the browser due to insufficient RAM.
Getting Blazor to render HTML when given markdown source is pretty easy with Markdig library. Working around the markdown limitations is not pretty though, and I ended up using inline HTML inside markdown pretty frequently.
Acknowledgments
The following solver from year 2019 was a source of inspiration: https://sanraith.github.io/aoc2019/.
This GitHub repo has some beautiful C# solutions: https://github.com/encse/adventofcode/tree/master/2020. While I solved all the problems on my own, I did look up other people’s solutions afterwards, and incorporated a few improvements into my code.