Compare commits
No commits in common. "865bb99c90db4c71f820c269b0970a261bae6370" and "44b07c2f8f1dba630d4e9b474bebbd2cf706c9fc" have entirely different histories.
865bb99c90
...
44b07c2f8f
2000
data/day_1.txt
2000
data/day_1.txt
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
|||||||
include(joinpath(readchomp(`git rev-parse --show-toplevel`), "aoc.jl"))
|
include(joinpath(readchomp(`git rev-parse --show-toplevel`), "aoc.jl"))
|
||||||
import .Aoc: @aoc
|
import .Aoc: @aoc
|
||||||
|
|
||||||
function sliding(in, w::Int64; step::Int = 1)
|
function sliding(in, w)
|
||||||
((@view in[i:i+w-1]) for i in 1:step:length(in)-w+1)
|
((@view in[i:i+w-1]) for i in 1:1:length(in)-w+1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function day1(in, w)
|
function day1(in, w)
|
||||||
@ -17,12 +17,12 @@ function day1(in, w)
|
|||||||
c
|
c
|
||||||
end
|
end
|
||||||
|
|
||||||
function p1(input::Vector{String})
|
function p1(input)
|
||||||
day1(input, 1)
|
day1(input, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function p2(input::Vector{String})
|
function p2(input)
|
||||||
day1(input, 3)
|
day1(input, 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user