<Compile Include="Day4.fs" />
<Compile Include="Program.fs" />
<None Include="App.config" />
- <None Include="Data\day1">
+ <None Include="Data\day1.input">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Data\day2">
+ <None Include="Data\day2.input">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Data\day4.input">
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.
[<assembly: AssemblyTitle("AdventOfCode2017")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
-[<assembly: AssemblyCompany("MATISA Matériel Industriel S.A.")>]
+[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("AdventOfCode2017")>]
-[<assembly: AssemblyCopyright("Copyright © MATISA Matériel Industriel S.A. 2017")>]
+[<assembly: AssemblyCopyright("")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]
-// 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.
[<assembly: ComVisible(false)>]
[<assembly: Guid("d3555943-8102-43d1-b3cb-570a4e4ec513")>]
// 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:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("1.0.0.0")>]
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 () =
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
[<EntryPoint>]
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
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.
[<assembly: AssemblyTitle("Tests")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("Tests")>]
-[<assembly: AssemblyCopyright("Copyright © 2017")>]
+[<assembly: AssemblyCopyright("")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]
-// 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.
[<assembly: ComVisible(false)>]
[<assembly: Guid("238bffbe-e2d4-4dc4-804c-6e43205e4701")>]
// 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:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("1.0.0.0")>]