Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- data Board
- allSquares :: Board -> [(Pos, Square)]
- emptyBoard :: Board
- placeTile :: Board -> Tile -> Pos -> Maybe Board
- occupiedSquareAt :: Board -> Pos -> Maybe Square
- lettersAbove :: Board -> Pos -> Seq (Pos, Square)
- lettersBelow :: Board -> Pos -> Seq (Pos, Square)
- lettersLeft :: Board -> Pos -> Seq (Pos, Square)
- lettersRight :: Board -> Pos -> Seq (Pos, Square)
- unoccupiedSquareAt :: Board -> Pos -> Maybe Square
Documentation
allSquares :: Board -> [(Pos, Square)] Source
Returns all the squares on the board, ordered by column then row.
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