diff --git a/haskell/Pre.hs b/haskell/Pre.hs index 3ed2811..5f7f4db 100644 --- a/haskell/Pre.hs +++ b/haskell/Pre.hs @@ -25,6 +25,7 @@ module Pre ( module Data.Void, module Data.Word, module Linear, + module Safe, module Test.Tasty, module Test.Tasty.Golden, module Test.Tasty.HUnit, @@ -71,6 +72,7 @@ import Data.Traversable import Data.Void import Data.Word import Linear (V2 (..)) +import Safe import Test.Tasty import Test.Tasty.Golden hiding (Always) import Test.Tasty.HUnit diff --git a/haskell/Puzzles/Day8.hs b/haskell/Puzzles/Day8.hs index caacb3a..55796bd 100644 --- a/haskell/Puzzles/Day8.hs +++ b/haskell/Puzzles/Day8.hs @@ -24,6 +24,11 @@ puzzle = -- TODO more principled way of distinguishing example and real (!! ((if length boxes == 20 then 10 else if length boxes == 1000 then 1000 else undefined))) $ connectBoxes boxes + , TL.show + . maybe (error "sets never unified") (\((V3 x1 _ _, V3 x2 _ _), _) -> x1 * x2) + . lastMay + . takeWhile ((> 1) . DS.sets . snd) + . connectBoxes ] , extraTests = mempty } diff --git a/outputs/real/8/2 b/outputs/real/8/2 new file mode 100644 index 0000000..1002d99 --- /dev/null +++ b/outputs/real/8/2 @@ -0,0 +1 @@ +78894156 \ No newline at end of file