Day 13 (#15)
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/all-checks-complete Pipeline was successful

Co-authored-by: Smaug123 <patrick+github@patrickstevens.co.uk>
Reviewed-on: #15
This commit is contained in:
2023-12-13 12:59:57 +00:00
parent 362a73cc41
commit dc0aa1ce30
9 changed files with 308 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 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]

View File

@@ -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)>]

View File

@@ -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
|]