Skip to main content

Crate contract_bridge

Crate contract_bridge 

Source
Expand description

§contract-bridge

Build Status Crates.io Docs.rs

Data types and primitives for the game of contract bridge.

This crate provides the shared “lingo” — cards, hands, deals, seats, bids, contracts, scoring, auctions, hand evaluation, and random deal generation — used by higher-level bridge crates such as dds-bridge (a double-dummy solver wrapper) and pons (analysis and simulation).

§Features

  • serde — derive Serialize / Deserialize on all public types that support it.
  • rand — enable the deck module for random card shuffling and deal generation.

Re-exports§

pub use contract::Bid;
pub use contract::Contract;
pub use contract::Level;
pub use contract::Penalty;
pub use deal::Builder;
pub use deal::FullDeal;
pub use deal::PartialDeal;
pub use hand::Card;
pub use hand::Hand;
pub use hand::Holding;
pub use hand::Rank;
pub use seat::Seat;
pub use seat::SeatFlags;

Modules§

auction
Auction lingo: calls, legal-call enforcement, and the sequence of calls that make up the bidding phase of a deal.
contract
Bidding, penalties, and scoring in contract bridge.
deal
Four-hand deal containers.
eval
Hand evaluation: HCP, shortness, Fifths, BUM-RAP, losing trick count, NLTC, and Zar points.
hand
Card primitives: ranks, cards, holdings, and hands.
seat
Table positions and bitsets over them.

Structs§

ParseStrainError
Error returned when parsing a Strain fails
ParseSuitError
Error returned when parsing a Suit fails
SuitFromNotrumpError
Error raised when converting Strain::Notrump to a suit

Enums§

Strain
Denomination, a suit or notrump
Suit
A suit of playing cards