Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Game
- player1 :: Game -> Player
- player2 :: Game -> Player
- optionalPlayers :: Game -> Maybe (Player, Maybe Player)
- currentPlayer :: Game -> Player
- board :: Game -> Board
- bag :: Game -> LetterBag
- dictionary :: Game -> Dictionary
- playerNumber :: Game -> Int
- moveNumber :: Game -> Int
- makeGame :: (Player, Player, Maybe (Player, Maybe Player)) -> LetterBag -> Dictionary -> Either ScrabbleError Game
- getGameStatus :: Game -> GameStatus
- data GameStatus
- gameStatus :: Game -> GameStatus
- players :: Game -> [Player]
- passes :: Game -> Int
- numberOfPlayers :: Game -> Int
- history :: Game -> History
- data History = History LetterBag (Seq Move)
- movesMade :: Game -> [Move]
Documentation
currentPlayer :: Game -> Player Source
dictionary :: Game -> Dictionary Source
playerNumber :: Game -> Int Source
moveNumber :: Game -> Int Source
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.
getGameStatus :: Game -> GameStatus Source
gameStatus :: Game -> GameStatus Source
numberOfPlayers :: Game -> Int Source