From: Greg Burri Date: Sun, 3 Dec 2017 14:28:28 +0000 (+0100) Subject: Day 3 X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=ee1a65b36a9b0bfa5564af03c0c6c4b8c780e0b5;p=advent_of_code_2017.git Day 3 --- diff --git a/AdventOfCode2017/AdventOfCode2017.fsproj b/AdventOfCode2017/AdventOfCode2017.fsproj index 4092b9b..31f6027 100644 --- a/AdventOfCode2017/AdventOfCode2017.fsproj +++ b/AdventOfCode2017/AdventOfCode2017.fsproj @@ -25,7 +25,7 @@ AnyCPU bin\$(Configuration)\$(AssemblyName).XML true - 2 + 3 pdbonly @@ -58,6 +58,7 @@ + diff --git a/AdventOfCode2017/Program.fs b/AdventOfCode2017/Program.fs index b541671..2c103a7 100644 --- a/AdventOfCode2017/Program.fs +++ b/AdventOfCode2017/Program.fs @@ -10,11 +10,15 @@ let day2 () = let array = File.ReadAllText "Data/day2" |> Day2.parseInput sprintf "part1 = %A, part2 = %A" (Day2.checksum1 array) (Day2.checksum2 array) +let day3 () = + let input = 325489 + sprintf "part1 = %A, part2 = %A" (Day3.spiralManhattanDistanceSum input) (Day3.spiralAdjacentSumBiggerThan input) let doDay (n : int) = let result = match n with | 2 -> day2 () + | 3 -> day3 () | _ -> day1 () printfn "Result of day %i: %s" n result