Implementation of the deck collection type.
Project description
Deck
Deck is an implementation of the deck
collection type, commonly confused with collections.deque
.
>>> from deck import Deck
>>> d = Deck()
>>> d.shuffle()
>>> d.deal()
Card(<Suit.Diamonds: '♦'>, <Value.Two: 2>)
>>> d.deal()
Card(<Suit.Diamonds: '♦'>, <Value.Three: 3>)
>>> d.deal()
Card(<Suit.Hearts: '♥'>, <Value.Ten: 10>)
>>> d.deal()
Card(<Suit.Diamonds: '♦'>, <Value.Nine: 9>)
Deck supports cheating, if that's how you want to play.
>>> d.deal_from_bottom()
Card(<Suit.Spades: '♠'>, <Value.Five: 5>)
Importing the deck
module also globally corrects other typographical errors that may occur in your code.
>>> import deck
>>> from collections import deck
>>> deck
<class 'deck.Deck'>
Taking this module too seriously would be a mistake.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
deck-3.0.0rc1.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file deck-3.0.0rc1.tar.gz
.
File metadata
- Download URL: deck-3.0.0rc1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0a0e09e1b4501fa7fc373c8ebd64f018f1cbf01972a368fc6728b8912012296 |
|
MD5 | 36ee8583fff455310a95b8292543d89b |
|
BLAKE2b-256 | 6e526394d8396dac1e9affd6c173ea9a9dd84b2199fe55f0ae2ce12f1832cb74 |
File details
Details for the file deck-3.0.0rc1-py3-none-any.whl
.
File metadata
- Download URL: deck-3.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5264ff10b4553bd70068b55c9fe4c1f802be507dafb56b3fb7df8ea9cd37bbb3 |
|
MD5 | 1ae6caafebbd9f69a16a1b88bd9ddd2b |
|
BLAKE2b-256 | 36bf0cbc3f61f44d36a09ae97fb3cecad7392f67b99394211be394b1ef9a2fdd |