yatzy v1.0.0 Yatzy View Source

Documentation for Yatzy.

Link to this section Summary

Functions

Ending a game

Starting a game

(Re)Rolling the dices for a given player

Scoring the current roll for a player

Link to this section Types

Link to this type

roll_options()

View Source
roll_options() :: [{:reroll, [integer()]}]

Link to this section Functions

Link to this function

end_game(game_state)

View Source
end_game(game_state :: Yatzy.Game.t()) :: Yatzy.Game.t()

Ending a game

Link to this function

new_game(players)

View Source
new_game([String.t()]) :: {:ok, Yatzy.Game.t()} | {:error, String.t()}

Starting a game

Link to this function

roll(game_state, player, opts \\ [])

View Source
roll(
  game_state :: Yatzy.Game.t(),
  player :: String.t(),
  roll_options :: roll_options()
) :: Yatzy.Game.t()

(Re)Rolling the dices for a given player

Link to this function

save(game_state, player, rule)

View Source
save(game_state :: Yatzy.Game.t(), player :: String.t(), rule :: atom()) ::
  Yatzy.Game.t()

Scoring the current roll for a player