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

Safe HaskellSafe-Inferred

Data.Puzzles.GridShape

Description

Grid shapes.

Synopsis

Documentation

class Show (Cell a) => GridShape a whereSource

The geometry of a grid.

Associated Types

type GridSize a :: *Source

type Cell a :: *Source

type Vertex a :: *Source

Methods

size :: a -> GridSize aSource

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 

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