View Source FiveHundred.Bid (Five Hundred v0.1.0)

Models a bid for a conventional game. Consists of a name, suit, tricks, and points.

Link to this section Summary

Functions

bids/0 returns a list of available bids.

Compares two bids by points.

Link to this section Types

@type special_bid() :: %FiveHundred.Bid{
  name: String.t(),
  points: 250 | 500 | 1000,
  suit: :no_trumps,
  tricks: 10
}
@type t() :: %FiveHundred.Bid{
  name: String.t(),
  points: 40..1000,
  suit: FiveHundred.Card.suit(),
  tricks: integer()
}

Link to this section Functions

@spec bids() :: [t()]

bids/0 returns a list of available bids.

TricksSpadesClubsDiamondsHeartsNo Trumps
6 tricks406080100120
7 tricks140160180200220
8 tricks240260280300320
9 tricks340360380400420
10 tricks440460480500520
Misere250
Open Misere500
Blind Misere1000
@spec compare(t(), t()) :: :lt | :gt | :eq

Compares two bids by points.

@spec sort_by_points([t()]) :: [t()]