Advent of Code 2021 in Common Lisp

Disclaimer

It’s a learning project, so the solutions may be lacking some mastery. Any remarks on how to improve the code are more than welcome!

Prerequisites

Evaluation of the code assumes sbcl and quicklisp installed and available.

To use get_input script, file env.lisp must be created with contents like:

(defconstant *token* "your-aoc-session-cookie")

The code in dayNN.lisp files is written with assumption that it’s being evaluated in Emacs with sly connection.

Solutions

puzzlenotes
Day 1reduce (would be better with loop)
Day 2loop with accumulating values
Day 3rotating a list and recursion
Day 4using helpers from day 3 + parsing input (partition-by)
Day 5grid (hashmap)
Day 6more thinking than writing
Day 7iteration + arithmetic
Day 8sets
Day 9maze: flood-fill algo, flet & labels
Day 10queueing
Day 11cf. day 9 (improved with hashmap and #'coordinates)
Day 12heap-heap-hoorray!
Day 13grid
Day 14hash-tables, no brutes!
Days 15-19todo
Day 20tricky spec, otherwise cool (arrays)