View Source Briscola.Deck (Briscola v0.1.1)

Struct representing a deck of cards.

Summary

Functions

Create a new deck of cards, not shuffled.

Shuffle a deck of cards.

Take a number of cards from the top of the deck. The top of the deck is the beginning of the list of cards.

Types

t()

@type t() :: %Briscola.Deck{cards: [Briscola.Card.t()]}

Functions

new()

@spec new() :: t()

Create a new deck of cards, not shuffled.

shuffle(deck)

Shuffle a deck of cards.

take(deck, n)

@spec take(t(), integer()) :: {t(), [Briscola.Card.t()]}

Take a number of cards from the top of the deck. The top of the deck is the beginning of the list of cards.