Basic structure; day 1, 2
This commit is contained in:
41
Justfile
Normal file
41
Justfile
Normal file
@@ -0,0 +1,41 @@
|
||||
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
|
||||
raku day-{{day}}/main.raku $f
|
||||
done
|
||||
|
||||
watch day=day:
|
||||
watchexec just test {{day}}
|
||||
Reference in New Issue
Block a user