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'>
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-2.1.tar.gz
(1.9 kB
view details)
Built Distribution
deck-2.1-py3-none-any.whl
(3.1 kB
view details)
File details
Details for the file deck-2.1.tar.gz
.
File metadata
- Download URL: deck-2.1.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.19.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f243a06e8263511c7b4a0f53bd4f8eef980787d4797bd76a541e523a5ba7a03a |
|
MD5 | daace0296203c360784418807fce3657 |
|
BLAKE2b-256 | 19adda9a8b8dd61328a7656d6a0209c8939dcc66a7464bd8ae72ba68d3fe6764 |
File details
Details for the file deck-2.1-py3-none-any.whl
.
File metadata
- Download URL: deck-2.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.19.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 739ff7656ee0fdb49c4d01e1098557ecd41f4f5b5f5768386848e98d625e430f |
|
MD5 | 38f374f5159e89d16b8c942c7e3aa4f8 |
|
BLAKE2b-256 | ff833d26b5f31bf64b1bea4a81bd1b7bc0fa3810bffbcea55c982534b632ccd1 |