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)