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

Safe HaskellNone
LanguageHaskell98

Wordify.Rules.Game

Synopsis

Documentation

makeGame :: (Player, Player, Maybe (Player, Maybe Player)) -> LetterBag -> Dictionary -> Either ScrabbleError Game Source

Starts a new game.

A game has at least 2 players, and 2 optional players (player 3 and 4.) The players should be newly created, as tiles from the letter bag will be distributed to each player.

Takes a letter bag and dictionary, which should be localised to the same language.

Yields a tuple with the first player and the initial game state. Returns a Left if there are not enough tiles in the letter bag to distribute to the players.

data History Source

Constructors

History LetterBag (Seq Move) 

Instances

movesMade :: Game -> [Move] Source

Returns a history of the moves made in the game.