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.
Metadata
Release files for CardGameBase 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| CardGameBase-1.0.6.tar.gz | 6.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| CardGameBase-1.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.7 kB
Release files / CardGameBase-1.0.6.tar.gz
| Download URL | CardGameBase-1.0.6.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13cc97ee5063458a8d26cadc1f324a04abae04c24a4f7747c91f4d764e3c2c9b
|
|
BLAKE2b-256 checksum How to use checksums |
177e6d4cd12e592b4626ed590f1545f429eff84669dd26c21de9bf0df8d0c07b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.11
|
Release files / CardGameBase-1.0.6-py3-none-any.whl
| Download URL | CardGameBase-1.0.6-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf24cf5b9153e031749d2dc21879af2e8fdefa55427cfc86ffbba923b2b18e38
|
|
BLAKE2b-256 checksum How to use checksums |
f2574a2a7a15c1b37c41331c8838b7ab742b503e5d57669714353b61a5ca709c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.11
|