puzzle-draw-0.3.0.0: Creating graphics for pencil puzzles.

Safe HaskellSafe
LanguageHaskell98

Data.Grid

Description

Puzzle grids.

Synopsis

Documentation

type Grid k a = Map k a Source #

nodes :: Grid N a -> Set N Source #

sizeGrid :: (Ord k, FromCoord k) => Size -> Grid k () Source #

Create a dummy grid of the given size.

clues :: Grid k (Maybe a) -> Grid k a Source #

For a grid with value type Maybe a, return an association list of cells and Just values.

nodeGrid :: Grid C a -> Grid N () Source #

A grid of empty nodes with all nodes of the cells of the first grid.

cellGrid :: Grid N a -> Grid C () Source #

borders :: Eq a => Grid C a -> [Edge N] Source #

The inner edges of a grid that separate unequal cells.

skeletons :: Eq a => Grid C a -> [Edge C] Source #

The skeletons of connected equal cells.

edgesGen :: Dual' k => (a -> a -> Bool) -> (a -> Bool) -> Map k a -> [Edge (Dual k)] Source #

colour :: Eq a => Grid C a -> Grid C Int Source #

collectLines :: (Key k, Eq a) => Grid k (Maybe a) -> [Edge k] Source #

rows :: Map C a -> [[a]] Source #

data OutsideClues k a Source #

Clues along the outside of a square grid. Ordered such that coordinates increase.

Constructors

OC 

Fields

Instances
Functor (OutsideClues k) Source # 
Instance details

Defined in Data.Grid

Methods

fmap :: (a -> b) -> OutsideClues k a -> OutsideClues k b #

(<$) :: a -> OutsideClues k b -> OutsideClues k a #

Eq a => Eq (OutsideClues k a) Source # 
Instance details

Defined in Data.Grid

Methods

(==) :: OutsideClues k a -> OutsideClues k a -> Bool #

(/=) :: OutsideClues k a -> OutsideClues k a -> Bool #

Show a => Show (OutsideClues k a) Source # 
Instance details

Defined in Data.Grid

outsideGrid :: (Ord k, FromCoord k) => OutsideClues k a -> Grid k () Source #

Create a dummy grid matching the given outside clues in size.