From: Grégory Burri Date: Tue, 4 Dec 2018 06:53:19 +0000 (+0100) Subject: Merge. X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=8b89e3626441437e52d7938e4d788452a327d9ff;p=advent_of_code_2018.git Merge. --- 8b89e3626441437e52d7938e4d788452a327d9ff diff --cc Program.fs index 71135ba,21b5ab7..1fe631b --- a/Program.fs +++ b/Program.fs @@@ -4,13 -4,25 +4,25 @@@ open Syste open System.IO let day01 () = - let input = File.ReadAllText "Data/day01.input" |> Day01.parseInput - input + let changes = File.ReadAllText "Data/day01.input" |> Day01.parseInput + sprintf "part1 = %A, part2 = %A" (Day01.finalFrequency changes) (Day01.firstDuplicate changes) + + let day02 () = + let ids = File.ReadAllText "Data/day02.input" |> Day02.parseInput + let idLength = ids.[0].Length + sprintf "part1 = %A, part2 = %A" (Day02.checksum ids) (Day02.findTwoStingsWithCommonChars ids (idLength - 1)) + + let day03 () = + let claims = File.ReadAllText "Data/day03.input" |> Day03.parseInput + let surface, claimId = Day03.overlappingSurface claims + sprintf "part1 = %A, part2 = %A" surface claimId -let days : (unit -> string) array = - [| - day01 - day02 - day03 - |] +let days : Map string> = + [ + 1, day01 ++ 2, day02 ++ 3, day03 + ] |> Map.ofList let doDay (n : int) = if n < 1 then