From 892e5a8ac9cebf916926d74f64d402088f84430b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 16 Dec 2017 18:11:35 +0100 Subject: minor edits --- .Puzzle15.hs.swo | Bin 12288 -> 0 bytes Puzzle16.hs | 4 +--- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 .Puzzle15.hs.swo diff --git a/.Puzzle15.hs.swo b/.Puzzle15.hs.swo deleted file mode 100644 index 7290ce3..0000000 Binary files a/.Puzzle15.hs.swo and /dev/null differ 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] -- cgit v1.2.3