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

Safe HaskellSafe
LanguageHaskell98

Data.Puzzles.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.

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 #

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 # 

Methods

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

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

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

Methods

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

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

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

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

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