sln_2017_15
Copyright(c) Eric Mertens 2017
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Main

Description

https://adventofcode.com/2017/day/15

Day 15 has us comparing two number sequence generators together to find pairs that match on the lowest 16 bits.

Synopsis

Documentation

main :: IO () Source #

Print the solution to Day 15. Input file can be overridden with command-line arguments.

match :: Int -> Int -> Bool Source #

Check if the first 16-bits of a pairs of numbers match.

nextA :: Int -> Int Source #

Step functions for the generators.

nextB :: Int -> Int Source #

Step functions for the generators.

isDivisibleBy Source #

Arguments

:: Int

divisor

-> Int

dividend

-> Bool 

Returns true if the divisor evenly divides the dividend.

>>> isDivisibleBy 2 10
True
>>> isDivisibleBy 3 10
False