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