This commit is contained in:
George Thomas 2025-12-08 22:42:57 +00:00
parent d0488726a0
commit 25efc19b31

View File

@ -13,20 +13,22 @@ puzzle =
{ number = 8
, parser = \isRealData -> (if isRealData then 1000 else 10,) <$> (V3 <$> decimal <* single ',' <*> decimal <* single ',' <*> decimal) `sepEndBy` newline
, parts =
[ uncurry \n -> TL.show
. product
. take 3
. sortOn Down
. map length
. DS.toLists
. snd
. (!! n)
. connectBoxes
, uncurry . const $ TL.show
. maybe (error "sets never unified") (\((V3 x1 _ _, V3 x2 _ _), _) -> x1 * x2)
. lastMay
. takeWhile ((> 1) . DS.sets . snd)
. connectBoxes
[ uncurry \n ->
TL.show
. product
. take 3
. sortOn Down
. map length
. DS.toLists
. snd
. (!! n)
. connectBoxes
, uncurry . const $
TL.show
. maybe (error "sets never unified") (\((V3 x1 _ _, V3 x2 _ _), _) -> x1 * x2)
. lastMay
. takeWhile ((> 1) . DS.sets . snd)
. connectBoxes
]
, extraTests = mempty
}