My Clojure solutions for the annual Advent of Code. Currently, only solutions for 2020, although I may backfill my (partial) 2019 solutions.
In order:
- 100% the AOC in a timely manner
- Take minimal Advent-specific help from r/adventofcode or the Clojurians advent channel
- Write reasonably idiomatic Clojure code, of reasonable quality
I finished the AOC on December 30th! It was a tremendously fun ride, and very satisfying to complete.
I took minimal help from the internet:
- I took help from the Clojurians channel -- from Aleksandr Zhuravlёv in particular -- on day 23, and was grateful to learn about deftype and how it enables one to define mutable Java types.
- I learned about Instaparse from the Slack channel, and used it to redo my day 19 solution.
- I learned about
*warn-on-reflection*
,*unchecked-math*
from Clojurians, and applied where appropriate
I reviewed Clojurian solutions after my own completion; occasionally I applied something I saw to clean up my own code, but for the most part my solutions are unchanged from their original form.
In order to finish on time and leave room for my day job and holiday fun, I sacrificed somewhat on code quality, but not so much that I'm embarrassed to publicize the repo.
In the beginning I played around with abstracting out some boilerplate using a function called day
; while it helped me move fast in the beginning, it proved to hinder me as the solutions got more verbose.
- Create utility functions for repetitive tasks, namely input parsing, working with grids/coordinates
- If optimizing on time-to-star, search for and make use of libraries, clojure.walk, etc.
- Time all solutions, and play with optimizations