2021-11-29 11:34:50 +01:00
|
|
|
#!/bin/sh
|
|
|
|
day="$1"
|
|
|
|
part="$2"
|
|
|
|
|
|
|
|
day="$(printf '%02d' "$day")"
|
|
|
|
|
2021-12-02 10:25:13 +01:00
|
|
|
name="Day${day}/Part${part}"
|
|
|
|
|
|
|
|
if zig -h > /dev/null && test -f "${name}.zig"; then
|
|
|
|
zig build-exe --name run "${name}.zig"
|
|
|
|
elif luac -v > /dev/null && test -f "${name}.lua"; then
|
|
|
|
luac -o luac.out "${name}.lua"
|
2021-11-30 22:49:02 +01:00
|
|
|
printf '#!/bin/sh\nlua luac.out "$@"\n' > run
|
|
|
|
chmod u+x run
|
2021-12-02 10:25:13 +01:00
|
|
|
elif stack > /dev/null && test -f "${name}.hs"; then
|
2021-11-29 11:34:50 +01:00
|
|
|
#stack build
|
2021-12-02 10:25:13 +01:00
|
|
|
stack ghc -- -O3 "${name}.hs" -o run
|
2021-11-29 11:34:50 +01:00
|
|
|
fi
|