From 83ba48e7ed4a9fc663ab0ac8752258797a379a8b Mon Sep 17 00:00:00 2001 From: Javran Cheng Date: Thu, 18 Jan 2024 22:17:27 -0800 Subject: [PATCH] write golden. --- README.md | 2 +- data/testdata/2023/day/10/e2.expect.txt | 2 ++ data/testdata/2023/day/10/example.expect.txt | 2 ++ data/testdata/2023/day/10/p2-1.expect.txt | 2 ++ data/testdata/2023/day/10/p2-2.expect.txt | 2 ++ data/testdata/2023/day/10/p2-3.expect.txt | 2 ++ src/Javran/AdventOfCode/Y2023/Day10.hs | 2 +- test/Javran/AdventOfCode/TestdataSpec.hs | 2 +- 8 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 data/testdata/2023/day/10/e2.expect.txt create mode 100644 data/testdata/2023/day/10/example.expect.txt create mode 100644 data/testdata/2023/day/10/p2-1.expect.txt create mode 100644 data/testdata/2023/day/10/p2-2.expect.txt create mode 100644 data/testdata/2023/day/10/p2-3.expect.txt diff --git a/README.md b/README.md index a807ce77..749c0e5c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Solutions, scripting, and templates - all in one repo. | `<++++++++>` | `<++++++++>` | `<++++++++>` | `<++++++++>` | `<++++++++>` | | :-: | :-: | :-: | :-: | :-: | | ☑ [Day 1](src/Javran/AdventOfCode/Y2023/Day1.hs) | ☑ [Day 2](src/Javran/AdventOfCode/Y2023/Day2.hs) | ☑ [Day 3](src/Javran/AdventOfCode/Y2023/Day3.hs) | ☑ [Day 4](src/Javran/AdventOfCode/Y2023/Day4.hs) | ☑ [Day 5](src/Javran/AdventOfCode/Y2023/Day5.hs) | -| ☑ [Day 6](src/Javran/AdventOfCode/Y2023/Day6.hs) | ☑ [Day 7](src/Javran/AdventOfCode/Y2023/Day7.hs) | ☑ [Day 8](src/Javran/AdventOfCode/Y2023/Day8.hs) | ☑ [Day 9](src/Javran/AdventOfCode/Y2023/Day9.hs) | ☐ [Day 10](src/Javran/AdventOfCode/Y2023/Day10.hs) | +| ☑ [Day 6](src/Javran/AdventOfCode/Y2023/Day6.hs) | ☑ [Day 7](src/Javran/AdventOfCode/Y2023/Day7.hs) | ☑ [Day 8](src/Javran/AdventOfCode/Y2023/Day8.hs) | ☑ [Day 9](src/Javran/AdventOfCode/Y2023/Day9.hs) | ☑ [Day 10](src/Javran/AdventOfCode/Y2023/Day10.hs) | ### 2022 diff --git a/data/testdata/2023/day/10/e2.expect.txt b/data/testdata/2023/day/10/e2.expect.txt new file mode 100644 index 00000000..7232953e --- /dev/null +++ b/data/testdata/2023/day/10/e2.expect.txt @@ -0,0 +1,2 @@ +8 +1 diff --git a/data/testdata/2023/day/10/example.expect.txt b/data/testdata/2023/day/10/example.expect.txt new file mode 100644 index 00000000..dcb4347b --- /dev/null +++ b/data/testdata/2023/day/10/example.expect.txt @@ -0,0 +1,2 @@ +4 +1 diff --git a/data/testdata/2023/day/10/p2-1.expect.txt b/data/testdata/2023/day/10/p2-1.expect.txt new file mode 100644 index 00000000..be3c49d3 --- /dev/null +++ b/data/testdata/2023/day/10/p2-1.expect.txt @@ -0,0 +1,2 @@ +23 +4 diff --git a/data/testdata/2023/day/10/p2-2.expect.txt b/data/testdata/2023/day/10/p2-2.expect.txt new file mode 100644 index 00000000..a4a45f1c --- /dev/null +++ b/data/testdata/2023/day/10/p2-2.expect.txt @@ -0,0 +1,2 @@ +70 +8 diff --git a/data/testdata/2023/day/10/p2-3.expect.txt b/data/testdata/2023/day/10/p2-3.expect.txt new file mode 100644 index 00000000..5f206456 --- /dev/null +++ b/data/testdata/2023/day/10/p2-3.expect.txt @@ -0,0 +1,2 @@ +80 +10 diff --git a/src/Javran/AdventOfCode/Y2023/Day10.hs b/src/Javran/AdventOfCode/Y2023/Day10.hs index 78bed546..337f2d8b 100644 --- a/src/Javran/AdventOfCode/Y2023/Day10.hs +++ b/src/Javran/AdventOfCode/Y2023/Day10.hs @@ -342,7 +342,7 @@ findMainLoop gAll s (a, b) lts = length $ M.keys $ M.filter (== 4) contrib [(p,1), ((r,c+1), 1)] instance Solution Day10 where - solutionSolved _ = False + solutionSolved _ = True solutionRun _ SolutionContext {getInputS, answerShow} = do raw <- lines <$> getInputS let parsed@(g, s) = parseFromRaw raw diff --git a/test/Javran/AdventOfCode/TestdataSpec.hs b/test/Javran/AdventOfCode/TestdataSpec.hs index b06dbeda..e9bac89b 100644 --- a/test/Javran/AdventOfCode/TestdataSpec.hs +++ b/test/Javran/AdventOfCode/TestdataSpec.hs @@ -34,7 +34,7 @@ import Test.Hspec {- ORMOLU_DISABLE -} hashForForceRecompliation :: String -- FORCE_RECOMP_HASH_BEGIN -hashForForceRecompliation = "813679e173330260898b25c2748d8d5f064b46b3976a7919b051d61e1acb2243" +hashForForceRecompliation = "c4190a564c90608ad38d838a767c7c2f0ad494f8cebe6ed0ce1adf640a277403" -- FORCE_RECOMP_HASH_END {- ORMOLU_ENABLE -}