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

Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Puzzles.GridShape

Description

Grid shapes.

Synopsis

Documentation

class Show (Cell a) => GridShape a where Source

The geometry of a grid.

Associated Types

type GridSize a :: * Source

type Cell a :: * Source

type Vertex a :: * Source

Methods

size :: a -> GridSize a Source

cells :: a -> [Cell a] Source

vertices :: a -> [Vertex a] Source

neighbours :: a -> Cell a -> [Cell a] Source

Instances

data Square Source

A standard square grid, with cells and vertices indexed by pairs of integers in mathematical coordinates. The bottom-left corner is vertex (0, 0), the bottom-left cell is cell (0, 0).

Constructors

Square !Int !Int 

Instances

data Dir Source

Edge direction in a square grid, vertical or horizontal.

Constructors

V 
H 

Instances

data Edge Source

An edge in a square grid, going up or right from the given cell centre.

Constructors

E (Cell Square) Dir 

Instances