Solve day 8 part 2
This commit is contained in:
parent
c39113dd0e
commit
43918c70fa
@ -25,6 +25,7 @@ module Pre (
|
|||||||
module Data.Void,
|
module Data.Void,
|
||||||
module Data.Word,
|
module Data.Word,
|
||||||
module Linear,
|
module Linear,
|
||||||
|
module Safe,
|
||||||
module Test.Tasty,
|
module Test.Tasty,
|
||||||
module Test.Tasty.Golden,
|
module Test.Tasty.Golden,
|
||||||
module Test.Tasty.HUnit,
|
module Test.Tasty.HUnit,
|
||||||
@ -71,6 +72,7 @@ import Data.Traversable
|
|||||||
import Data.Void
|
import Data.Void
|
||||||
import Data.Word
|
import Data.Word
|
||||||
import Linear (V2 (..))
|
import Linear (V2 (..))
|
||||||
|
import Safe
|
||||||
import Test.Tasty
|
import Test.Tasty
|
||||||
import Test.Tasty.Golden hiding (Always)
|
import Test.Tasty.Golden hiding (Always)
|
||||||
import Test.Tasty.HUnit
|
import Test.Tasty.HUnit
|
||||||
|
|||||||
@ -24,6 +24,11 @@ puzzle =
|
|||||||
-- TODO more principled way of distinguishing example and real
|
-- TODO more principled way of distinguishing example and real
|
||||||
(!! ((if length boxes == 20 then 10 else if length boxes == 1000 then 1000 else undefined))) $
|
(!! ((if length boxes == 20 then 10 else if length boxes == 1000 then 1000 else undefined))) $
|
||||||
connectBoxes boxes
|
connectBoxes boxes
|
||||||
|
, TL.show
|
||||||
|
. maybe (error "sets never unified") (\((V3 x1 _ _, V3 x2 _ _), _) -> x1 * x2)
|
||||||
|
. lastMay
|
||||||
|
. takeWhile ((> 1) . DS.sets . snd)
|
||||||
|
. connectBoxes
|
||||||
]
|
]
|
||||||
, extraTests = mempty
|
, extraTests = mempty
|
||||||
}
|
}
|
||||||
|
|||||||
1
outputs/real/8/2
Normal file
1
outputs/real/8/2
Normal file
@ -0,0 +1 @@
|
|||||||
|
78894156
|
||||||
Loading…
x
Reference in New Issue
Block a user