Card Game Base with basic deck and card class
Project description
Card Game Base
Create Card Games with ease
How to install:
pip install CardGameBase
or
pip3 install CardGameBase
How to use:
from CardGameBase.Utility import create_classic_deck
from CardGameBase import Hand
# Create a classic 52 card deck and shuffle
my_deck = create_classic_deck()
my_deck.shuffle()
# Create hands for 2 players
my_hand = Hand(my_deck)
my_friends_hand = Hand(my_deck)
# Take cards
for i in range(7):
my_hand.draw()
my_friends_hand.draw()
# Display both players hands
print(my_hand, f"= {my_hand.get_total_value()}")
print(my_friends_hand, f"= {my_friends_hand.get_total_value()}")
# Check who has the highest hand value
if my_hand > my_friends_hand:
print("You won!")
else:
print("Your friend won!")
For more Information please have look at the Documentation.
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
CardGameBase-1.0.3.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file CardGameBase-1.0.3.tar.gz
.
File metadata
- Download URL: CardGameBase-1.0.3.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41950b4e10ac373c142c4728a8e9bd79a1607436845cac512d6969f6009f32e7 |
|
MD5 | 5a19b660c99fc4e391ec1c3b34027efe |
|
BLAKE2b-256 | b71e82fb43900b9ea1d46e46bf74e83400a806193b3863a6a57e079b6854708c |
File details
Details for the file CardGameBase-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: CardGameBase-1.0.3-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3bd3e0acabef94b61c2c8859b8accf9be04b2f70bb95cd2fefe5b4c524802e6 |
|
MD5 | 646cb5c30b6a01425f19e2cb5678fec3 |
|
BLAKE2b-256 | f87480e7469811af3fc9bef0bbe1fbe07b543a2ea4da1cc29adbae0482cb128f |