Skip to main content

A package containing the logic for the card game Whist and its variants.

Project description

pywhist

A package containing the logic for the card game Whist and its variants.

How to install

pip install whist

How to use

whist contains a wide range of utility to work with playing cards and perform Whist game logic.

Playing with cards

>>> from whist.cards import Deck
>>> deck = Deck.full_deck()
>>> deck.shuffle()
>>> cards = [card.symbol for card in deck.cards]
>>> print(cards[:3])
['๐Ÿƒ™', '๐Ÿ‚ฅ', '๐Ÿ‚ฆ']

Interactive play

$ย python -m whist.game

=== Turn: north ===

  east: ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚ 
 south: ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚ 
  west: ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚  ๐Ÿ‚ 

Your partner: south

Pile:

Your hand: ๐Ÿƒ– ๐Ÿƒ› ๐Ÿƒ‚ ๐Ÿƒ† ๐Ÿƒ‡ ๐Ÿƒ‹ ๐Ÿ‚ด ๐Ÿ‚น ๐Ÿ‚บ ๐Ÿ‚ฝ ๐Ÿ‚ข ๐Ÿ‚ฉ ๐Ÿ‚ซ

Actions:
 0: ๐Ÿƒ–
 1: ๐Ÿƒ›
 2: ๐Ÿƒ‚
 3: ๐Ÿƒ†
 4: ๐Ÿƒ‡
 5: ๐Ÿƒ‹
 6: ๐Ÿ‚ด
 7: ๐Ÿ‚น
 8: ๐Ÿ‚บ
 9: ๐Ÿ‚ฝ
10: ๐Ÿ‚ข
11: ๐Ÿ‚ฉ
12: ๐Ÿ‚ซ
>

Project details


Download files

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

Source Distribution

whist-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

whist-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file whist-0.1.0.tar.gz.

File metadata

  • Download URL: whist-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.8.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for whist-0.1.0.tar.gz
Algorithm Hash digest
SHA256 714da2e6983b5a30fcc29e5449b0cbb8a5f85a1e724a4356f5f952404e6ac832
MD5 803f901250f0ac7d57640b545f61d649
BLAKE2b-256 68c44bb65b903ce30733d6dc9837fc1173ab1f4e66a3bdac541eb72ee5fd22d1

See more details on using hashes here.

File details

Details for the file whist-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: whist-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.8.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for whist-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1358ae4f22c680b2041562a4026b8f059cfaa071a81889c5771ab1e0ff839ff
MD5 de0cd54bb9b61486eb770e35acc509bb
BLAKE2b-256 715b11a6d0f8fbad214238b7a922260b0d964496edef45fdf91303c03608e479

See more details on using hashes here.

Supported by

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