Skip to main content

Card domain primitives for the game Hundred and Ten

Project description

hundredandten-deck

Card domain primitives for the game Hundred and Ten. This package has zero dependencies and is used by all other packages in the workspace.

from hundredandten.deck import Card, CardSuit, CardNumber, Deck, SelectableSuit

deck = Deck()
hand = deck.draw(5)

trump = SelectableSuit.HEARTS
for card in hand:
    print(card, card.trump_for_selection(trump))

Exports

Symbol Description
Card Frozen dataclass for a single playing card. Fields: number (CardNumber), suit (CardSuit). Properties: trump_value, weak_trump_value, always_trump. Method: trump_for_selection(trump).
CardSuit Enum of suits: HEARTS, DIAMONDS, SPADES, CLUBS, JOKER.
CardNumber Enum of card values: TWO through ACE plus JOKER.
SelectableSuit Enum of the four choosable trump suits: HEARTS, DIAMONDS, SPADES, CLUBS.
ALL_CARDS list[Card] — all 53 cards in the deck (52 standard + Joker), in a fixed order.
Deck A seeded, shuffled deck. Construct with an optional seed string; call deck.draw(n) to pull n cards.

Card Values

Two card value scales exist:

  • trump_value — used when the card's suit is the selected trump suit (or the card is always-trump). Higher is better.
  • weak_trump_value — used when the card leads a trick with no trumps played. Higher is better.

Black suits (Spades, Clubs) have reversed number card ordering in both scales — a lower pip value beats a higher one.

The Ace of Hearts and the Joker have always_trump = True, meaning card.trump_for_selection(any_suit) returns True regardless of what suit is chosen.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hundredandten_deck-0.0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file hundredandten_deck-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: hundredandten_deck-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hundredandten_deck-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 486366409501a1bb6a1a4337fa439c5f5823d4a0c2db0a795ca6628c0041db58
MD5 f5116e2c913fc570d67c703fab9a6ba5
BLAKE2b-256 345488281b0f6ad1e05e5e8abbb81c45def1bd81c15d4ca083e0f28906c11da5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page