poker_game v0.1.0 Poker View Source

Documentation for Poker.

Link to this section Summary

Types

t()

Defines poker game

Functions

Scores poker hand We convert our hand to a tuple with 2 elements: {ranking , {tuple with card rankings}} this can be easily compared as the rank is on the most sighificant place it gets compared first if we have identical ranks then we compare cards from the most sighificant

Starts the game

Link to this section Types

Specs

t() :: %Poker{
  deck: CardDeck.deck(),
  pile: CardDeck.deck(),
  players: %{required(String.t()) => CardDeck.deck()}
}

Defines poker game

Link to this section Functions

Specs

deal(CardDeck.t(), list()) :: t()

Scores poker hand We convert our hand to a tuple with 2 elements: {ranking , {tuple with card rankings}} this can be easily compared as the rank is on the most sighificant place it gets compared first if we have identical ranks then we compare cards from the most sighificant

Examples

iex> {1, {5, 4, 3, 2, 1}} > {3, {3, 2, 1}} false iex> {4, {5, 4, 3}} > {3, {3, 2, 1}} true

Link to this function

hand_type(a, a, a, a, b)

View Source
Link to this function

new_card(game, player, card)

View Source

Specs

new_card(t(), integer(), integer() | [integer()]) :: t()

Specs

start([String.t()]) :: t()

Starts the game

Examples