From 56093667dff8c97f6c3cd3d3efb1da12b8409ad9 Mon Sep 17 00:00:00 2001 From: Ummon Date: Mon, 4 Dec 2017 08:01:57 +0100 Subject: [PATCH] Cleaning --- AdventOfCode2017/AdventOfCode2017.fsproj | 4 ++-- AdventOfCode2017/AssemblyInfo.fs | 18 +++++++++--------- AdventOfCode2017/Program.fs | 10 ++++++---- Tests/AssemblyInfo.fs | 16 ++++++++-------- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/AdventOfCode2017/AdventOfCode2017.fsproj b/AdventOfCode2017/AdventOfCode2017.fsproj index c2c8a6c..dac598e 100644 --- a/AdventOfCode2017/AdventOfCode2017.fsproj +++ b/AdventOfCode2017/AdventOfCode2017.fsproj @@ -62,10 +62,10 @@ - + PreserveNewest - + PreserveNewest diff --git a/AdventOfCode2017/AssemblyInfo.fs b/AdventOfCode2017/AssemblyInfo.fs index 3e9afcd..0ca00a3 100644 --- a/AdventOfCode2017/AssemblyInfo.fs +++ b/AdventOfCode2017/AssemblyInfo.fs @@ -4,20 +4,20 @@ open System.Reflection open System.Runtime.CompilerServices open System.Runtime.InteropServices -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [] [] [] -[] +[] [] -[] +[] [] [] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [] @@ -25,13 +25,13 @@ open System.Runtime.InteropServices [] // Version information for an assembly consists of the following four values: -// +// // Major Version -// Minor Version +// Minor Version // Build Number // Revision -// -// You can specify all the values or you can default the Build and Revision Numbers +// +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [] [] diff --git a/AdventOfCode2017/Program.fs b/AdventOfCode2017/Program.fs index f0c7ca1..52ac0e9 100644 --- a/AdventOfCode2017/Program.fs +++ b/AdventOfCode2017/Program.fs @@ -1,13 +1,14 @@ module AdventOfCode2017.Main open System.IO +open System let day1 () = - let captcha = File.ReadAllText "Data/day1" |> Day1.parseInput + let captcha = File.ReadAllText "Data/day1.input" |> Day1.parseInput sprintf "part1 = %A, part2 = %A" (Day1.solveCaptcha1 captcha) (Day1.solveCaptcha2 captcha) let day2 () = - let array = File.ReadAllText "Data/day2" |> Day2.parseInput + let array = File.ReadAllText "Data/day2.input" |> Day2.parseInput sprintf "part1 = %A, part2 = %A" (Day2.checksum1 array) (Day2.checksum2 array) let day3 () = @@ -21,10 +22,11 @@ let day4 () = let doDay (n : int) = let result = match n with + | 1 -> day1 () | 2 -> day2 () | 3 -> day3 () | 4 -> day4 () - | _ -> day1 () + | _ -> raise <| NotImplementedException () printfn "Result of day %i: %s" n result [] @@ -34,6 +36,6 @@ let main argv = if argv.Length > 0 then doDay (int argv.[0]) else - for d = 1 to 24 do + for d = 1 to 25 do doDay d 0 diff --git a/Tests/AssemblyInfo.fs b/Tests/AssemblyInfo.fs index 243ecf4..5eef19a 100644 --- a/Tests/AssemblyInfo.fs +++ b/Tests/AssemblyInfo.fs @@ -4,7 +4,7 @@ open System.Reflection open System.Runtime.CompilerServices open System.Runtime.InteropServices -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [] @@ -12,12 +12,12 @@ open System.Runtime.InteropServices [] [] [] -[] +[] [] [] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [] @@ -25,13 +25,13 @@ open System.Runtime.InteropServices [] // Version information for an assembly consists of the following four values: -// +// // Major Version -// Minor Version +// Minor Version // Build Number // Revision -// -// You can specify all the values or you can default the Build and Revision Numbers +// +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [] [] -- 2.45.2