Day 14 (#16)
Co-authored-by: Smaug123 <patrick+github@patrickstevens.co.uk> Reviewed-on: #16
This commit is contained in:
@@ -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]
|
||||
|
@@ -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)>]
|
||||
|
@@ -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
|
||||
|]
|
||||
|
Reference in New Issue
Block a user