BASIC_CARD
This module is for anyone who is interested in creating their own card game. The functions included are self explanatory and allow to perform basic fucntions on an indidual card, deck of cards or individual hands. It uses the external pygame module to display the cards visually hence this can be used along with pygame module. It also uses the python in-built random module.
METHODS INCLUDED
-
compare_cards(c1, c2) : Takes two arguments of which both are instances of the Card object. Returns the highest value of the card. 'A', 'K', 'Q' and so on are deemed highest in that order. Feel free to modify according to your needs.
-
match_card(i, x, y): Takes three arguments. 'i' refers to the instance of the Card object. 'x' refers to the x coordinate and 'y' refers to the y coordinate the card should be blitted on the screen. x and y starts from the top left corner of the screen.
-
have_suits(hand, s): Takes two arguments where 'hand' refers to a hand which is a list object with instances of the Card object. 's' refers to the suit which is a string ('hearts', 'clubs', 'spades', 'diamonds'). Returns a boolean of either True if have and False if not.
-
least_high_card(c, hand): Takes two argumensts where 'c' refers to an instance of Card object. 'hand' refers to a list object containing instances of the Card object. Returns the highest card in the hand but lower than 'c'
-
lowest_valuCard_of_suit(hand, s): Takes two arguements where 'hand' refers to a list object containing instances of the Card object. 's' refers to the suit which is a string ('hearts', 'clubs', 'spades', 'diamonds'). Returns the lowest value of the card from the suit 's'.
-
lowest_valueCard(hand): Takes one argument where 'hand' refers to a list object with instances of the Card object. Returns the lowest value of a card in the 'hand'.
-
highest_valueCard_of_suit(hand, s): Takes two arguements where 'hand' refers to a list object containing instances of the Card object. 's' refers to the suit which is a string ('hearts', 'clubs', 'spades', 'diamonds'). Returns the highest value of the card from the suit 's'.
-
highest_valueCard(hand): Takes one argument where 'hand' refers to a list object with instances of the Card object. Returns the highest value of a card in the 'hand'.
Credit for the png images of the card pack goes to: Andrew Tidey http://creativecommons.org/publicdomain/zero/1.0/ Licensed under MIT License Thanks
Change Log
0.0.1 (26/07/2020)
- First Release
Metadata
Release files for basic-card-hannu-hell 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| basic_card-hannu_hell-0.0.1.tar.gz | 3.4 kB | Without provenance | Details |
Release files / basic_card-hannu_hell-0.0.1.tar.gz
| Download URL | basic_card-hannu_hell-0.0.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2b480ecc02b4e0d57f90acf2e0a677deb8a7186808c7737caf3a63732db630e
|
|
BLAKE2b-256 checksum How to use checksums |
f52170d95359af19c3b2cf1cc040e49065a0ff97d894a5d3cba71ad9a621ee9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.4
|
Security for basic-card-hannu-hell 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.