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

Uploaded Source

Built Distribution

CardGameBase-1.0.6-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: CardGameBase-1.0.6.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for CardGameBase-1.0.6.tar.gz
Algorithm Hash digest
SHA256 13cc97ee5063458a8d26cadc1f324a04abae04c24a4f7747c91f4d764e3c2c9b
MD5 3d168dca92c51a0011802c6fe2f5f160
BLAKE2b-256 177e6d4cd12e592b4626ed590f1545f429eff84669dd26c21de9bf0df8d0c07b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: CardGameBase-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for CardGameBase-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bf24cf5b9153e031749d2dc21879af2e8fdefa55427cfc86ffbba923b2b18e38
MD5 a67875aa15d3c2e7a922ff1803d7ce69
BLAKE2b-256 f2574a2a7a15c1b37c41331c8838b7ab742b503e5d57669714353b61a5ca709c

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