aoc2017-0.1.0.0: Advent of Code 2017 - my answers

Safe HaskellNone
LanguageHaskell2010

Day22

Description

 

Synopsis

Documentation

data O Source #

A cardinal direction.

Constructors

U 
R 
D 
L 

data S Source #

Node state.

Constructors

C 
W 
I 
F 

next :: (Bounded a, Enum a, Eq a) => a -> a Source #

succ with wraparound.

prev :: (Bounded a, Enum a, Eq a) => a -> a Source #

pred with wraparound.

move :: O -> Z -> Z Source #

Moves a Cartesian coordinate by one step in a direction.

parse :: String -> [Z] Source #

Parses a string as a 2-D grid centered around (0, 0), returning positions with a # character.

day22 :: (Enum a, Eq a) => a -> (a -> O -> O) -> (a -> a) -> a -> Int -> [Z] -> Int Source #

Returns all viral activity from an initial state.