This commit is contained in:
Smaug123
2023-12-14 08:34:04 +00:00
parent dc0aa1ce30
commit a3bb7471cc
9 changed files with 189 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 13 (fun day -> Path.Combine (dir.FullName, "inputs", $"day%i{day + 1}.txt") |> File.ReadAllText)
Array.init 14 (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)>]
[<Params(11, 12, 13, 14)>]
member val Day = 0 with get, set
[<Params(false, true)>]

View File

@@ -185,6 +185,18 @@ module Run =
if shouldWrite then
Console.WriteLine output
let day14 (partTwo : bool) (input : string) =
if not partTwo then
let output = Day14.part1 input
if shouldWrite then
Console.WriteLine output
else
let output = Day14.part2 input
if shouldWrite then
Console.WriteLine output
let allRuns =
[|
day1
@@ -200,4 +212,5 @@ module Run =
day11
day12
day13
day14
|]