X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=advent11p.hs;h=24955b90358d463d04653f3207e28a8f1db3c28d;hb=e244d245682d465eb3784ac0ac2ba13342628810;hp=6e4e47d83d8ca97c9641f7a458a84239baa0bb0d;hpb=07af81c3e7a0489c32c6e1471a14fb84cfe24184;p=advent-of-code-16.git diff --git a/advent11p.hs b/advent11p.hs index 6e4e47d..24955b9 100644 --- a/advent11p.hs +++ b/advent11p.hs @@ -106,9 +106,9 @@ candidates agendum closed = newCandidates candidate = current agendum previous = trail agendum succs = legalSuccessors $ successors candidate - -- nonloops = (succs \\ previous) \\ closed - excludable = previous ++ closed - nonloops = filter (\s -> not $ (canonical s) `elem` excludable) succs + -- excludable = previous ++ closed + -- nonloops = filter (\s -> not $ (canonical s) `elem` excludable) succs + nonloops = filter (\s -> not $ (canonical s) `elem` closed) succs newCandidates = map (\a -> (cost a, a)) $ map (\n -> makeAgendum n) nonloops makeAgendum new = Agendum {current = new, trail = (canonical candidate):previous,