Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Game playerId
- data Outcome playerId
- finalScores :: Ord playerId => Outcome playerId -> [(playerId, Int)]
- makeGame :: Ord playerId => PlayerSet playerId -> Game playerId
- newRound :: (Functor m, MonadRandom m, Ord playerId, Show playerId) => Game playerId -> m (Round playerId)
- newRound' :: (Ord playerId, Show playerId) => Game playerId -> FullDeck -> Round playerId
- players :: Game playerId -> PlayerSet playerId
- playersWon :: Ord playerId => Game playerId -> [playerId] -> Either (Outcome playerId) (Game playerId)
- roundsPlayed :: Game playerId -> Int
- scores :: Ord playerId => Game playerId -> [(playerId, Int)]
- winners :: Ord playerId => Outcome playerId -> [playerId]
Documentation
finalScores :: Ord playerId => Outcome playerId -> [(playerId, Int)] Source
Get the final scores at the end of the game.
makeGame :: Ord playerId => PlayerSet playerId -> Game playerId Source
Create a new game for the given set of players.
newRound :: (Functor m, MonadRandom m, Ord playerId, Show playerId) => Game playerId -> m (Round playerId) Source
Start a new round of the game, shuffling the deck cards ourselves.
newRound' :: (Ord playerId, Show playerId) => Game playerId -> FullDeck -> Round playerId Source
Start a new round of the game with an already-shuffled deck of cards.
playersWon :: Ord playerId => Game playerId -> [playerId] -> Either (Outcome playerId) (Game playerId) Source
Indicate that the specified players won.
Since 0.3, will also rotate the order of play, so the person to the left of the previous first person is now the first.
roundsPlayed :: Game playerId -> Int Source
Return the number of rounds played.