aoc2017-0.1.0.0: Advent of Code 2017 - my answers

Safe HaskellSafe
LanguageHaskell2010

Day19

Description

 

Synopsis

Documentation

data Direction Source #

Represents a cardinal direction.

Constructors

U 
D 
L 
R 

parse :: IArray a Char => String -> (a (Int, Int) Char, (Int, Int)) Source #

Returns the 2D representation of a string by lines and the index of the only | pipe character on the first line.

rot180 :: Direction -> Direction Source #

Rotates a cardinal direction by 180 degrees.

move :: Num a => (a, a) -> Direction -> (a, a) Source #

Moves a point one step in a cardinal direction.

joints :: (IArray a Char, Ix i, Num i) => a (i, i) Char -> (i, i) -> [Direction] Source #

Returns the cardinal directions around a point which contain non-space.

walk :: (IArray a Char, Ix i, Num i) => a (i, i) Char -> (i, i) -> Direction -> String Source #

Walks a maze from a starting point in a direction until it runs of non-space characters to follow. Returns a list of all characters on the walk.