Skip to main content

This is a python package for implementing the card game Caravan

Project description

why?

This Python package will help you implement the Caravan card game.

The most important thing it does is add cards to the caravan pile using the "add_card" method. If it is impossible to add a card, the caravan does not change.

It also has several auxiliary methods, such as "price" - which allows you to estimate the cost of a caravan, or "direction_check", which allows you to determine the direction of the stack (increasing or descending).

Playing cards are implemented using the "Card" class, which contains the name of the card and its suit.

So far this package does not contain manipulations with the Joker card, but it will be added in the future. (maybe)

jack add instruction

You must enter a list of cards [name1, suit1, name2, suit2...], where name (1-13) are in odd places, and suit (1-4) are in even places. The sequence of cards must be a valid caravan. (there should be no jacks in it, and the number card should come first).

You also need to select the card on which you want to place the jack. Jack can only be placed on number cards.

For example, you can use python -m caravanassets -cards "[1, 2, 3, 4, 13, 2, 4, 2]" output: Three Clubs King Diamonds Four Diamonds

by default the program uses jack on the first card

but if you need to use it on other card, you can use python -m caravanassets -cards "[1, 2, 3, 4, 13, 2, 4, 2]" -addj 2 output: Ace Diamonds Four Diamonds

the jack removed the second card, and all the picture cards on it.

input

-cards / --caravan (necessary)

-addj / --addjack (not necessary)

installation

pip install caravanassets

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

caravanassets-0.1.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

caravanassets-0.1.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file caravanassets-0.1.3.tar.gz.

File metadata

  • Download URL: caravanassets-0.1.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for caravanassets-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8bd51f3327d21eb8ebe768ae4b974bac88eb76953d835772c6f6ad412cd1e535
MD5 a818861c4b7931646d38cf2fb69acb2d
BLAKE2b-256 424576f4774fedf95b7036171f99028a48cf304c917f72a37eca65cde9fd5f7d

See more details on using hashes here.

File details

Details for the file caravanassets-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for caravanassets-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1737a9a34fd9092f9c2d89a9a4f39e599b995e8a0268d2154617afc11580e257
MD5 e70ca5e9e718f48100839dfcde7d8d6a
BLAKE2b-256 93110e3a863d33363c9b6beedac522da8398af23a2dce19bee5ad9fab1605a16

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