~reesmichael1/adventofcode

Solutions for the Advent of Code puzzles
Add (slow) solutions for all of 2022
Add solution for 2022 day 23
Add solution for 2022 day 14

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~reesmichael1/adventofcode
read/write
git@git.sr.ht:~reesmichael1/adventofcode

You can also use your local clone with git send-email.

#Advent of Code Solutions

These solutions are written in Nim. There are solutions for several years now, although I tend to drop off in the last week or so. (I'm an organist in the real world, and Advent is a busy time!)

#Task Runner

I had some fun with Nim metaprogramming and built a task runner that will automatically load any solution files in the src directory at compile time. (After all, what's the fun in doing something simply and straightforwardly without overengineering?) To use it:

cd 2022
nimble build --gc:arc -d:danger
./bin/runner  # The solutions do not handle relative paths

The runner will notify you if the files in the src directory do not match those that have been compiled into it.

#Scaffolder

You can run nimble scaffold {year} {day} to generate a template file for a given day.

#Helper Functions

The input module has some helper functions to access the input data. Any input files should be put in an input directory at the top of the year with the name dayN. If there's test data to debug, you can store it as testDayN and use the --test flag when running the individual day's solution.