diff options
-rw-r--r-- | .Puzzle15.hs.swo | bin | 12288 -> 0 bytes | |||
-rw-r--r-- | Puzzle16.hs | 4 |
2 files changed, 1 insertions, 3 deletions
diff --git a/.Puzzle15.hs.swo b/.Puzzle15.hs.swo Binary files differdeleted file mode 100644 index 7290ce3..0000000 --- a/.Puzzle15.hs.swo +++ /dev/null diff --git a/Puzzle16.hs b/Puzzle16.hs index 4124197..57e0c8f 100644 --- a/Puzzle16.hs +++ b/Puzzle16.hs @@ -34,13 +34,11 @@ solve1' xs = foldr1 (.) (reverse $ parseIns <$> parseInput xs) solve1 :: [Char] -> [Char] solve1 xs = solve1' xs ['a'..'p'] -f = take 100 $ iterate (solve1' input0) "abcde" - iterateWithCount :: (Int, [Char]) -> (Int, [Char]) iterateWithCount (n, xs) = (n + 1, solve1' input xs) oneCycle :: Int -oneCycle = fst $ until ((==['a'..'p']) . snd) iterateWithCount (1, res1) -- g == 60 +oneCycle = fst $ until ((==['a'..'p']) . snd) iterateWithCount (1, res1) -- oneCycle == 60 where res1 = solve1 input solve2 :: [Char] |