trunk
HeNine 3 years ago
parent f20910934b
commit 482dcf4295

@ -0,0 +1,7 @@
name = "day01"
uuid = "c690254d-3454-492b-8cfb-6117f61a80e0"
authors = ["HeNine "]
version = "0.1.0"
[deps]
Lazy = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0"

@ -0,0 +1,10 @@
199
200
208
210
200
207
240
269
260
263

File diff suppressed because it is too large Load Diff

@ -0,0 +1,38 @@
module day01
using Lazy
function task1(file::IOStream)
@as x eachline(file) begin
parse.(Int, x)
map(<, x, x[2:end])
sum(x)
end
end
function task2(file::IOStream)
@as x eachline(file) begin
parse.(Int, x)
map((y...) -> sum(y), x, x[2:end], x[3:end])
map(<, x, x[2:end])
sum(x)
end
end
end # module
println("Day 01 Task 1 Case 0")
open(day01.task1, "day01\\data\\case00.txt") |> println
println("Day 01 Task 1 Case 1")
open(day01.task1, "day01\\data\\case01.txt") |> println
println("Day 01 Task 2 Case 0")
open(day01.task2, "day01\\data\\case00.txt") |> println
println("Day 01 Task 2 Case 1")
open(day01.task2, "day01\\data\\case01.txt") |> println
Loading…
Cancel
Save