43 lines
935 B
Makefile
43 lines
935 B
Makefile
default:
|
|
just --list
|
|
|
|
_curl day url *args:
|
|
curl --cookie "session=$AOC_SESSION" --user-agent "AOC curl scripts by bluepython508" {{args}} https://adventofcode.com/2024/day/{{trim_start_match(day, '0')}}/{{url}}
|
|
|
|
day := `date +'%d'`
|
|
new day=day:
|
|
#!/usr/bin/env bash
|
|
set -euxo pipefail
|
|
mkdir day-{{day}}/
|
|
just _curl {{day}} input -o day-{{day}}/input
|
|
cat > day-{{day}}/main.raku <<'MAIN'
|
|
use lib $*PROGRAM.parent.parent;
|
|
use Lib;
|
|
|
|
grammar Solution does AOC {
|
|
token TOP { }
|
|
|
|
method part1(::?CLASS:U: $v) {
|
|
}
|
|
|
|
method part2(::?CLASS:U: $v) {
|
|
}
|
|
}
|
|
|
|
|
|
Solution.main()
|
|
MAIN
|
|
|
|
run day=day:
|
|
raku day-{{day}}/main.raku day-{{day}}/input
|
|
|
|
test day=day:
|
|
#!/usr/bin/env bash
|
|
for f in day-{{day}}/example-*.in; do
|
|
tput setaf 2; echo $'\t'$f; tput setaf 7;
|
|
raku day-{{day}}/main.raku $f
|
|
done
|
|
|
|
watch day=day:
|
|
watchexec just test {{day}}
|