~keving/advent-of-code

My solutions for https://adventofcode.com/

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~keving/advent-of-code
read/write
git@git.sr.ht:~keving/advent-of-code

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

#Advent of Code

Here are my Advent of Code solutions!

Please don't come here looking for clean code. I try to keep things reasonnably readable, but my actual production code looks better I swear :)

There is one folder for each year, one subfolder for each day and one file for each part of the day. There is also a lib/ folder for helpers files.

The input is expeted in an input.txt file in the daily folder.

Here are some instructions for running the solutions in differennt languages.

#C

To build the helper library:

cd lib/
gcc -c advlib.c

Then, to compile a given solution:

cd YYYY/DD
gcc -o part1 -I ../../lib part1.c ../../lib/advlib.o -lm

#Hare

No library yet.

To run a specific solution:

hare run part1.ha

It's also possible to create the executable and run it separately:

$ hare build -o part1 part1.ha
$ ./part1

#Python

No library yet.

The version of Python I'm using will probably change from year to year. For 2024 it's 3.11.

python part1.py