haskellscrabble-0.1.0.0: A scrabble library capturing the core game logic of scrabble.

Safe HaskellSafe-Inferred
LanguageHaskell98

Wordify.Rules.Board

Synopsis

Documentation

data Board Source

Instances

allSquares :: Board -> [(Pos, Square)] Source

Returns all the squares on the board, ordered by column then row.

emptyBoard :: Board Source

Creates an empty board.

placeTile :: Board -> Tile -> Pos -> Maybe Board Source

Places a tile on a square and yields the new board, if the target square is empty. Otherwise yields Nothing.

occupiedSquareAt :: Board -> Pos -> Maybe Square Source

Returns the square at a given position if it is occupied by a tile. Otherwise returns Nothing.

lettersAbove :: Board -> Pos -> Seq (Pos, Square) Source

All letters immediately above a given square until a non-occupied square

lettersBelow :: Board -> Pos -> Seq (Pos, Square) Source

All letters immediately below a given square until a non-occupied square

lettersLeft :: Board -> Pos -> Seq (Pos, Square) Source

All letters immediately left of a given square until a non-occupied square

lettersRight :: Board -> Pos -> Seq (Pos, Square) Source

All letters immediately right of a given square until a non-occupied square

unoccupiedSquareAt :: Board -> Pos -> Maybe Square Source

Returns the square at a given position if it is not occupied by a tile. Otherwise returns Nothing.