Compare commits

...

2 Commits

Author SHA1 Message Date
Patrick Michl
865bb99c90 add day1 input 2021-12-01 08:11:11 +01:00
Patrick Michl
12bcda2d22 parameterize functions for faster compilation 2021-12-01 08:10:57 +01:00
2 changed files with 2004 additions and 4 deletions

2000
data/day_1.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
include(joinpath(readchomp(`git rev-parse --show-toplevel`), "aoc.jl"))
import .Aoc: @aoc
function sliding(in, w)
((@view in[i:i+w-1]) for i in 1:1:length(in)-w+1)
function sliding(in, w::Int64; step::Int = 1)
((@view in[i:i+w-1]) for i in 1:step:length(in)-w+1)
end
function day1(in, w)
@ -17,12 +17,12 @@ function day1(in, w)
c
end
function p1(input)
function p1(input::Vector{String})
day1(input, 1)
end
function p2(input)
function p2(input::Vector{String})
day1(input, 3)
end