This commit is contained in:
Smaug123
2023-12-14 23:18:38 +00:00
parent 9ec99c8ee9
commit 012bbdd46d
9 changed files with 93 additions and 2 deletions

View File

@@ -14,6 +14,6 @@ module Inputs =
if isNull dir then
failwith "reached root of filesystem without finding inputs dir"
Array.init 14 (fun day -> Path.Combine (dir.FullName, "inputs", $"day%i{day + 1}.txt") |> File.ReadAllText)
Array.init 15 (fun day -> Path.Combine (dir.FullName, "inputs", $"day%i{day + 1}.txt") |> File.ReadAllText)
let inline day (i : int) = days.[i - 1]

View File

@@ -44,7 +44,7 @@ module Benchmarks =
[<GlobalSetup>]
member _.Setup () = Run.shouldWrite <- false
[<Params(11, 12, 13, 14)>]
[<Params(11, 12, 13, 14, 15)>]
member val Day = 0 with get, set
[<Params(false, true)>]

View File

@@ -197,6 +197,18 @@ module Run =
if shouldWrite then
Console.WriteLine output
let day15 (partTwo : bool) (input : string) =
if not partTwo then
let output = Day15.part1 input
if shouldWrite then
Console.WriteLine output
else
let output = Day15.part2 input
if shouldWrite then
Console.WriteLine output
let allRuns =
[|
day1
@@ -213,4 +225,5 @@ module Run =
day12
day13
day14
day15
|]