summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsn <mail@mhsn.net>2025-09-24 16:35:08 +0100
committermhsn <mail@mhsn.net>2025-09-24 16:37:45 +0100
commit6f23d7806bbfcff9c22317825d763275f86c4815 (patch)
treed0d702c8772b27bdfea344a615cff535f0c6fa73
parentff88fb5d1b7f3dc52858f89c27f3646b493d4828 (diff)
downloadaoc-6f23d7806bbfcff9c22317825d763275f86c4815.tar.gz
aoc-6f23d7806bbfcff9c22317825d763275f86c4815.zip
shfmt
-rwxr-xr-xcheck25
-rwxr-xr-xinit26
2 files changed, 27 insertions, 24 deletions
diff --git a/check b/check
index 58b91e8..c609690 100755
--- a/check
+++ b/check
@@ -17,20 +17,23 @@ data_path=$aoc_path/data/$input.txt
case $lang in
python)
- solve=$aoc_path/python.py
- ;;
+ solve=$aoc_path/python.py
+ ;;
+raku)
+ solve=$aoc_path/raku.raku
+ ;;
rust)
- cargo build --target-dir /tmp/aoc_rust --manifest-path $aoc_path/rust/Cargo.toml
- solve=/tmp/aoc_rust/debug/aoc_$year-$day
- ;;
+ cargo build --target-dir /tmp/aoc_rust --manifest-path $aoc_path/rust/Cargo.toml
+ solve=/tmp/aoc_rust/debug/aoc_$year-$day
+ ;;
rustc)
- cargo build --release --target-dir /tmp/aoc_rust --manifest-path $aoc_path/rust/Cargo.toml
- solve=/tmp/aoc_rust/release/aoc_$year-$day
- ;;
+ cargo build --release --target-dir /tmp/aoc_rust --manifest-path $aoc_path/rust/Cargo.toml
+ solve=/tmp/aoc_rust/release/aoc_$year-$day
+ ;;
*)
- echo "unknown lang: $lang"
- exit 1
- ;;
+ echo "unknown lang: $lang"
+ exit 1
+ ;;
esac
result=$(cat $data_path | $solve)
diff --git a/init b/init
index cf1e395..79d8c69 100755
--- a/init
+++ b/init
@@ -16,23 +16,23 @@ touch $aoc_path/puzzle.txt
# data directory
if [ ! -d $aoc_path/data ]; then
- mkdir --parents $aoc_path/data
- for f in "test" "aoc"; do
- touch $aoc_path/data/$f.txt
- echo "silver: ???\ngold: ???" >$aoc_path/data/$f.ans
- done
+ mkdir --parents $aoc_path/data
+ for f in "test" "aoc"; do
+ touch $aoc_path/data/$f.txt
+ echo "silver: ???\ngold: ???" >$aoc_path/data/$f.ans
+ done
fi
case $lang in
python)
- cp $script_path/template/python.py $aoc_path
- ;;
+ cp $script_path/template/python.py $aoc_path
+ ;;
rust)
- cargo new --vcs none --name aoc_$year-$day $aoc_path/rust
- cp $script_path/template/main.rs $aoc_path/rust/src/main.rs
- ;;
+ cargo new --vcs none --name aoc_$year-$day $aoc_path/rust
+ cp $script_path/template/main.rs $aoc_path/rust/src/main.rs
+ ;;
*)
- echo unknown lang: $lang
- exit 1
- ;;
+ echo unknown lang: $lang
+ exit 1
+ ;;
esac