This commit is contained in:
Huanzo 2021-11-28 17:27:59 +01:00
parent 15d29a1403
commit ba2ae7d0cb

6
aoc.jl
View File

@ -26,7 +26,7 @@ end
function _setup_aoc(year, day) function _setup_aoc(year, day)
path = _data_path(day) path = _data_path(day)
if isfile(path) if isfile(path)
return return
end end
open(path, "w") do f open(path, "w") do f
write(f, _get_input(year, day)) write(f, _get_input(year, day))
@ -35,14 +35,14 @@ end
function _run_parts(day) function _run_parts(day)
if isdefined(Main, :p1) if isdefined(Main, :p1)
p1_res = @time Main.p1(_input(day)) p1_res = @time Main.p1(_input(day))
@info "Part 1: $p1_res" @info "Part 1: $p1_res"
else else
@info "p1() not defined. skipping..." @info "p1() not defined. skipping..."
end end
if isdefined(Main, :p2) if isdefined(Main, :p2)
p2_res = @time Main.p2(_input(day)) p2_res = @time Main.p2(_input(day))
@info "Part 2: $p2_res" @info "Part 2: $p2_res"
else else