diff --git a/2024/.gitignore b/2024/.gitignore new file mode 100644 index 0000000..15d7aef --- /dev/null +++ b/2024/.gitignore @@ -0,0 +1 @@ +inputs diff --git a/2024/benchmark b/2024/benchmark new file mode 100755 index 0000000..10fd522 --- /dev/null +++ b/2024/benchmark @@ -0,0 +1,20 @@ +#!/bin/sh +day="$(printf '%02d' ${1##0})" +part="$2" +inputfile="$PWD/../inputs/${day}.txt" + +[ -x "prepare" ] || exit 0 + +if ! ./prepare "$day" "$part"; then + echo 'eh ge hebt precies niet alles geïnstalleerd staan' +else + if [ -x "run" ]; then + hyperfine "./run '$day' '$part' '$inputfile'" + fi +fi + +if [ -x "clean" ]; then + ./clean +fi + +true diff --git a/2024/complete-benchmark b/2024/complete-benchmark new file mode 100755 index 0000000..b779f92 --- /dev/null +++ b/2024/complete-benchmark @@ -0,0 +1,35 @@ +#!/bin/sh +day="$(printf '%02d' ${1##0})" +part="$2" +inputfile="$3" + +case "$inputfile" in +"") inputfile="$PWD/francis-punt/${day}_input.txt";; +/*) ;; +*) inputfile="$PWD/$inputfile";; +esac + +if ! test -f "$inputfile"; then + echo "no input available" >&2 + exit 1 +fi + +for dir in *; do + if test -d "$dir"; then + cd "$dir" + if test -x ./prepare; then + echo "---------------------------------------------------------------------------------- $dir" + if ! ./prepare "$day" "$part" >&2; then + echo 'eh ge hebt precies niet alles geïnstalleerd staan' + else + if test -x run; then + hyperfine -n "$dir" "./run '$day' '$part' '$inputfile'" + fi + fi + fi + if test -x ./clean; then + ./clean "$day" "$part" "$inputfile" + fi + cd - > /dev/null 2>&1 + fi +done diff --git a/2024/jnms b/2024/jnms index 2cac13e..d517bad 160000 --- a/2024/jnms +++ b/2024/jnms @@ -1 +1 @@ -Subproject commit 2cac13e2408c975828b531f5f0f3af9a98e4d10a +Subproject commit d517bada96a2d890d41cdc1c7284e91f3845d45f