add lua solution for day 0
This commit is contained in:
parent
f4fa590833
commit
9aa652953c
8
Day00/Part1.lua
Normal file
8
Day00/Part1.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
io.input(arg[3])
|
||||||
|
local min, max = math.huge, -math.huge
|
||||||
|
for i = 1, io.read("*n") do
|
||||||
|
local num = io.read("*n")
|
||||||
|
max = math.max(num, max)
|
||||||
|
min = math.min(num, min)
|
||||||
|
end
|
||||||
|
print(min .. " " .. max)
|
2
clean
2
clean
@ -4,5 +4,5 @@ part="$2"
|
|||||||
|
|
||||||
day="$(printf '%02d' "$day")"
|
day="$(printf '%02d' "$day")"
|
||||||
|
|
||||||
rm -f ./run
|
rm -f ./run ./luac.out
|
||||||
rm -f "Day${1}/Part${2}.hi" "Day${1}/Part${2}.o"
|
rm -f "Day${1}/Part${2}.hi" "Day${1}/Part${2}.o"
|
||||||
|
6
prepare
6
prepare
@ -4,7 +4,11 @@ part="$2"
|
|||||||
|
|
||||||
day="$(printf '%02d' "$day")"
|
day="$(printf '%02d' "$day")"
|
||||||
|
|
||||||
if test -f "Day${day}/Part${part}.hs"; then
|
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
|
||||||
#stack build
|
#stack build
|
||||||
stack ghc -- -O3 "Day${day}/Part${part}.hs" -o run
|
stack ghc -- -O3 "Day${day}/Part${part}.hs" -o run
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user