From a751456596b8b8784db211f01e1b83ac665b7a56 Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Wed, 27 Dec 2017 19:10:40 +0100 Subject: [PATCH] Fix Haskell compilation on Arch Linux. --- 2017/day-15/Makefile | 2 +- 2017/day-15/input.txt | 2 ++ 2017/day-15/solution.hs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 2017/day-15/input.txt diff --git a/2017/day-15/Makefile b/2017/day-15/Makefile index a933dc4..b6dd19e 100644 --- a/2017/day-15/Makefile +++ b/2017/day-15/Makefile @@ -2,4 +2,4 @@ all: solution ./$< solution: solution.hs - ghc $< -o $@ + ghc -dynamic $< -o $@ diff --git a/2017/day-15/input.txt b/2017/day-15/input.txt new file mode 100644 index 0000000..46491bf --- /dev/null +++ b/2017/day-15/input.txt @@ -0,0 +1,2 @@ +Generator A starts with 618 +Generator B starts with 814 diff --git a/2017/day-15/solution.hs b/2017/day-15/solution.hs index bcc8cde..eb791ba 100644 --- a/2017/day-15/solution.hs +++ b/2017/day-15/solution.hs @@ -16,7 +16,7 @@ genB' n = filter (divisible 8) $ genB n main :: IO () main = do let aStart = 618 - let bStart = 814 + bStart = 814 print $ length $ filter judge $ take 40000000 $ drop 1 $ zip (genA aStart) (genB bStart) print $ length $ filter judge $ take 5000000 $ zip (genA' aStart) (genB' bStart)