This commit is contained in:
Patrick Stevens
2022-12-14 19:36:38 +00:00
committed by GitHub
parent 068755efd3
commit 7b966eaa18
13 changed files with 426 additions and 30 deletions

View File

@@ -23,6 +23,7 @@
<EmbeddedResource Include="..\AdventOfCode2022.Test\Inputs\Day11.txt" />
<EmbeddedResource Include="..\AdventOfCode2022.Test\Inputs\Day12.txt" />
<EmbeddedResource Include="..\AdventOfCode2022.Test\Inputs\Day13.txt" />
<EmbeddedResource Include="..\AdventOfCode2022.Test\Inputs\Day14.txt" />
</ItemGroup>
<ItemGroup>

View File

@@ -2,5 +2,5 @@ namespace AdventOfCode2022.App
[<RequireQualifiedAccess>]
module Inputs =
let days = Array.init 13 (fun day -> Assembly.readResource $"Day%i{day + 1}.txt")
let days = Array.init 14 (fun day -> Assembly.readResource $"Day%i{day + 1}.txt")
let inline day (i : int) = days.[i - 1]

View File

@@ -47,7 +47,7 @@ type Benchmark11To15 () =
[<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

@@ -188,6 +188,22 @@ module Run =
if shouldWrite then
printfn "%i" output
let day14 (partTwo : bool) (input : string) =
let day14 = StringSplitEnumerator.make '\n' input
if not partTwo then
let output = Day14.part1 day14
if shouldWrite then
printfn "%i" output
else
let output = Day14.part2 day14
if shouldWrite then
printfn "%i" output
let allRuns =
[|
day1
@@ -203,4 +219,5 @@ module Run =
day11
day12
day13
day14
|]