Copyright | (c) Eric Mertens 2017 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
https://adventofcode.com/2017/day/13
Day 13 asks us questions about packets traveling through a periodic scanner.
Documentation
type Scanners = [(Int, Int)] Source #
The scanners are represented by a pair of the number of time units it will take a packet to reach that scanner and the number of cells the scanner traverses.
Compute the solutions to day 13. Input can be ovverridden via command-line arguments.
Returns true when the scanner will be at position 0 at the given time-step.
>>>
collides 6 4
True>>>
collides 5 4
False
part1 :: Scanners -> Int Source #
Sum of the product of index and size of scanners that detect the packet.
>>>
part1 [(0,3),(1,2),(4,4),(6,4)]
24