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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

CardGameBase-1.0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: CardGameBase-1.0.1.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

Hashes for CardGameBase-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1b7d6e2ea4ecceb0c93e0c1b9d6c745b9456fe0e0dec0a471e4daa2a7fce331b
MD5 c5ead013f78944927f5d1752aee7125d
BLAKE2b-256 0a99f76ffa6b0dc009b9b4f9aeba77ca3ea014910889ece35460efe909cb142d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: CardGameBase-1.0.1-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

Hashes for CardGameBase-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3889a846adb8085255c88da6f8edd2ba1d6b682a136fc20e39c88bcc8a1ce95
MD5 fb2ea1cd667585969baafd0f641af721
BLAKE2b-256 aef6cf8a67a456a75bd0976c428083a2b1b484311d4cb681890521ddae27fe58

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page