From d3f79a2e12e5a3fe0a86aabb9acacee6b59763c4 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Thu, 1 Dec 2022 17:20:31 +0100 Subject: [PATCH] Update for 2022 --- .gitmodules | 3 +++ 2022/benchmark | 20 ++++++++++++++++++++ 2022/chvp | 1 + 2022/complete-benchmark | 30 ++++++++++++++++++++++++++++++ README.md | 26 ++++---------------------- 5 files changed, 58 insertions(+), 22 deletions(-) create mode 100755 2022/benchmark create mode 160000 2022/chvp create mode 100755 2022/complete-benchmark diff --git a/.gitmodules b/.gitmodules index 50b4092..3999ded 100644 --- a/.gitmodules +++ b/.gitmodules @@ -128,3 +128,6 @@ [submodule "2021/mraedis"] path = 2021/mraedis url = https://github.com/Mraedis/AoC2021/ +[submodule "2022/chvp"] + path = 2022/chvp + url = https://github.com/chvp/aoc2022.git diff --git a/2022/benchmark b/2022/benchmark new file mode 100755 index 0000000..681cbef --- /dev/null +++ b/2022/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" "$inputfile"; 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/2022/chvp b/2022/chvp new file mode 160000 index 0000000..01c09f9 --- /dev/null +++ b/2022/chvp @@ -0,0 +1 @@ +Subproject commit 01c09f921a4277d1e4de6211adef47ebee14080e diff --git a/2022/complete-benchmark b/2022/complete-benchmark new file mode 100755 index 0000000..7204b36 --- /dev/null +++ b/2022/complete-benchmark @@ -0,0 +1,30 @@ +#!/bin/sh +day="$(printf '%02d' ${1##0})" +part="$2" + +inputfile="$PWD/inputs/${day}.txt" + +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/README.md b/README.md index 2f178ea..b4145da 100644 --- a/README.md +++ b/README.md @@ -2,39 +2,21 @@ | Wie? | Waar? (Repository) | Taal? | | :------------- | :------------------------------------------------: | ---------: | -| chvp | https://github.com/chvp/aoc2021 | forth | -| ninewise | https://git.fuyu.moe/ninewise/adventofcode-2021 | lua | -| robbe | git@github.com:Robbe7730/adventofcode2021.git | ? | -| Flynn | https://gitlab.com/mcbloch/aoc2021 | Cpp | -| Silvius | https://github.com/ajuvercr/aoc-2021 | C | -| rien | https://github.com/rien/adventofcode2021 | C (no std) | -| iasoon | https://github.com/iasoon/aoc2021 | pony | -| Bond-009 | https://github.com/Bond-009/advent-of-code-2021 | Rust | -| Timpy | https://github.com/timodw/aoc_2021 | Python/Numpy| -| Swambino | https://github.com/AWerbrouck/AoC | py & haskell| -| Francis. | https://github.com/FKD13/AoC2021.git | Prolog | -| Lox | https://github.com/Silox/2021-advent-of-code.git | Ruby | -| beardhatcode | https://github.com/beardhatcode/aoc-2021 | Rust | -| redfast00 | https://github.com/redfast00/aoc2021 | Python | -| Jasper 2.0 | https://github.com/JasperJanin/advent-of-code-2021 | Kotlin | -| jaspervdj | https://github.com/jaspervdj/advent-of-code | Haskell | -| niknetniko | https://github.com/niknetniko/AdventOfCode | Elixir | -| francis | https://github.com/fbegyn/aoc2021 | Go | -| mraedis | https://github.com/Mraedis/AoC2021/ | Python | +| chvp | https://github.com/chvp/aoc2022 | Haskell | * repo clonen: ```sh git clone git@github.com:ZeusWPI/Advent-of-Code-Aggregator.git - git submodule init 2021 # just the current year + git submodule init 2022 # just the current year git submodule update ``` * nieuwe persoon toevoegen: ```sh - cd 2021 + cd 2022 git submodule add git commit -m 'hey guys ik heb een repo toegevoegd' ``` @@ -58,6 +40,6 @@ * benchmarks uitvoeren: ```sh - cd 2021 + cd 2022 ./complete-benchmark ```