Day 13 (#15)
Co-authored-by: Smaug123 <patrick+github@patrickstevens.co.uk> Reviewed-on: #15
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 12 (fun day -> Path.Combine (dir.FullName, "inputs", $"day%i{day + 1}.txt") |> File.ReadAllText)
|
||||
Array.init 13 (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)>]
|
||||
[<Params(11, 12, 13)>]
|
||||
member val Day = 0 with get, set
|
||||
|
||||
[<Params(false, true)>]
|
||||
|
@@ -173,6 +173,18 @@ module Run =
|
||||
if shouldWrite then
|
||||
Console.WriteLine output
|
||||
|
||||
let day13 (partTwo : bool) (input : string) =
|
||||
if not partTwo then
|
||||
let output = Day13.part1 input
|
||||
|
||||
if shouldWrite then
|
||||
Console.WriteLine output
|
||||
else
|
||||
let output = Day13.part2 input
|
||||
|
||||
if shouldWrite then
|
||||
Console.WriteLine output
|
||||
|
||||
let allRuns =
|
||||
[|
|
||||
day1
|
||||
@@ -187,4 +199,5 @@ module Run =
|
||||
day10
|
||||
day11
|
||||
day12
|
||||
day13
|
||||
|]
|
||||
|
Reference in New Issue
Block a user