Day 8 part 2
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
<EmbeddedResource Include="samples\day5.txt" />
|
||||
<EmbeddedResource Include="samples\day6.txt" />
|
||||
<EmbeddedResource Include="samples\day7.txt" />
|
||||
<EmbeddedResource Include="samples\day8part1.txt" />
|
||||
<EmbeddedResource Include="samples\day8.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace AdventOfCode2023.Test
|
||||
|
||||
open System
|
||||
open AdventOfCode2023
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
@@ -9,11 +8,11 @@ open System.IO
|
||||
[<TestFixture>]
|
||||
module TestDay8 =
|
||||
|
||||
let sample = Assembly.getEmbeddedResource typeof<Dummy>.Assembly "day8.txt"
|
||||
|
||||
[<Test>]
|
||||
let part1Sample () =
|
||||
sample |> Day8.part1 |> shouldEqual 2
|
||||
Assembly.getEmbeddedResource typeof<Dummy>.Assembly "day8part1.txt"
|
||||
|> Day8.part1
|
||||
|> shouldEqual 2
|
||||
|
||||
[<Test>]
|
||||
let part1Sample2 () =
|
||||
@@ -22,11 +21,14 @@ module TestDay8 =
|
||||
AAA = (BBB, BBB)
|
||||
BBB = (AAA, ZZZ)
|
||||
ZZZ = (ZZZ, ZZZ)"""
|
||||
|> Day8.part1 |> shouldEqual 6
|
||||
|> Day8.part1
|
||||
|> shouldEqual 6
|
||||
|
||||
[<Test>]
|
||||
let part2Sample () =
|
||||
sample |> Day8.part2 |> shouldEqual 0
|
||||
Assembly.getEmbeddedResource typeof<Dummy>.Assembly "day8.txt"
|
||||
|> Day8.part2
|
||||
|> shouldEqual 6uL
|
||||
|
||||
[<Test>]
|
||||
let part1Actual () =
|
||||
@@ -39,7 +41,7 @@ ZZZ = (ZZZ, ZZZ)"""
|
||||
Assert.Inconclusive ()
|
||||
failwith "unreachable"
|
||||
|
||||
Day8.part1 s |> shouldEqual 0
|
||||
Day8.part1 s |> shouldEqual 19199
|
||||
|
||||
[<Test>]
|
||||
let part2Actual () =
|
||||
@@ -52,4 +54,4 @@ ZZZ = (ZZZ, ZZZ)"""
|
||||
Assert.Inconclusive ()
|
||||
failwith "unreachable"
|
||||
|
||||
Day8.part2 s |> shouldEqual 0
|
||||
Day8.part2 s |> shouldEqual 13663968099527uL
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
RL
|
||||
LR
|
||||
|
||||
AAA = (BBB, CCC)
|
||||
BBB = (DDD, EEE)
|
||||
CCC = (ZZZ, GGG)
|
||||
DDD = (DDD, DDD)
|
||||
EEE = (EEE, EEE)
|
||||
GGG = (GGG, GGG)
|
||||
ZZZ = (ZZZ, ZZZ)
|
||||
11A = (11B, XXX)
|
||||
11B = (XXX, 11Z)
|
||||
11Z = (11B, XXX)
|
||||
22A = (22B, XXX)
|
||||
22B = (22C, 22C)
|
||||
22C = (22Z, 22Z)
|
||||
22Z = (22B, 22B)
|
||||
XXX = (XXX, XXX)
|
||||
|
||||
9
AdventOfCode2023.FSharp/Test/samples/day8part1.txt
Normal file
9
AdventOfCode2023.FSharp/Test/samples/day8part1.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
RL
|
||||
|
||||
AAA = (BBB, CCC)
|
||||
BBB = (DDD, EEE)
|
||||
CCC = (ZZZ, GGG)
|
||||
DDD = (DDD, DDD)
|
||||
EEE = (EEE, EEE)
|
||||
GGG = (GGG, GGG)
|
||||
ZZZ = (ZZZ, ZZZ)
|
||||
Reference in New Issue
Block a user