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.4-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hundredandten_deck-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 67e7d4b5d2adb94dc8301ece98b7504cb83b34e2c2e64f3d7f8efc3175640f73
MD5 e3173c6caf4416fa4cff94e7b2f814f1
BLAKE2b-256 dfd4835d34c7ace51e7aa8e2dd3deff8e786d7dd01e58722b75023eb3bfc1d3e

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