Skip to main content

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.5.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

CardGameBase-1.0.5-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file CardGameBase-1.0.5.tar.gz.

File metadata

  • Download URL: CardGameBase-1.0.5.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for CardGameBase-1.0.5.tar.gz
Algorithm Hash digest
SHA256 b92a3435c60d3d12a338fe91c50377853b09c9b011ae0d70d30e6313f7875cf9
MD5 994847a99f389583ea9733f8419fc1cd
BLAKE2b-256 0652643740b8fe4f572704a6ed08c49df0b2ae235e6e45638602aaa796a516b6

See more details on using hashes here.

File details

Details for the file CardGameBase-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for CardGameBase-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e0e473a958cef632acb26473566fe431fe09df7a898ac82f5fe58a6bd88f647b
MD5 b6a5a0f9400f76177769757e29750b61
BLAKE2b-256 942394012a3b2a15d754a127aebeeaa1a746b73ee9e990eb4e369545a6964829

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