~damien/advent

Advent of Code submissions
Remove input files
Add back 2023
Update Clojure patterns for running and testing

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~damien/advent
read/write
git@git.sr.ht:~damien/advent

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

Consolidated Advent of Code submissions

#Running

#Erlang

To run part1.erl:

$ erlc part1.erl
$ cat input | erl -noshell -s part1 -s init stop

To run tests in part1_tests.erl:

$ erlc part1_tests.erl
$ erl -noshell -s eunit test -s init stop

#Rust

To run:

$ cat input | cargo run

To test:

$ cargo test

#Zig

To run part1.zig:

$ cat input | zig run part1.zig

To test it:

$ zig test part1.zig

To debug the tests using GDB:

$ zig test part1.zig --test-cmd 'gdb' --test-cmd '--args' --test-cmd-bin --test-cmd "$(which zig)"

#Clojure

To run, you can use either of these patterns:

$ clj -M -m day01.part1 src/day01/input
$ cat src/day01/input | clj -M -m day01.part1

To test:

$ clj -X day01.part1/-test
#Instructions pre-2023:

To run src/part1.clj:

$ cat input | clj -X part1/-main

To test it:

$ clj -X part1/-test