From ee1a65b36a9b0bfa5564af03c0c6c4b8c780e0b5 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Sun, 3 Dec 2017 15:28:28 +0100 Subject: [PATCH] Day 3 --- AdventOfCode2017/AdventOfCode2017.fsproj | 3 ++- AdventOfCode2017/Program.fs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 -- 2.45.2