Skip to main content

JJC's Card Game

This is a simple card played over a series of round. Each round, players draw one card. The player with the highest card received 2 points. Players with penalty cards lose a point. First player to 21 points wins.

Installation

Make sure you have python 3.6 or higher installed, then:

pip install jjc-card-game

Play

Simply:

jjc-card-game

Then follow the on-screen rules and instructions.

Or try these more advanced options:

  • jjc-card-game -d Jonathan Nicholas Austin to play a game with these three players. The -d speeds up gameplay by dealing all the cards at once.
  • jjc-card-game --help to see even more options

Development

Development tools: Windows 10, PowerShell, and PyCharm.

git clone https://github.com/jonathanchukinas/card_game.git
cd card_game
pip install flit            # for build, packaging
python -m venv .venv        # create virtual environment
.venv\scripts\activate      # activate virtual environment
flit install --pth-file     # editable install 

# modify source code
jjc-card-game               # to run modified app
# repeat

deactivate                  # exit virtual environment

Running the tests

Test are written for pytest and automated by tox. They cover most of the game logic, but less than 50% of the command-line interface / ouput.

To run all the tests:

pip install tox, pytest
cd path\to\project\directory
tox

Tests will be run against all these python versions, if you have them:

  • v3.6
  • v3.7
  • v3.8

For a faster way to run tests:

pytest

Built With

python and python packages:

  • click for created command line interface
  • PTable for generating pretty scorecard tables

Authors

  • Jonathan Chukinas - initial release

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgements

  • Brian Okken for his Test & Code podcast and Python Testing with pytest book, which jump-started my testing knowledge early in 2019 and recently helped me integrate pytest, flit, and tox together.
  • Luciano Ramalho for his outstanding Fluent Python, which taught me much of what I know about python under the hood, dunder methods, lru cache, etc.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jjc-card-game-0.0.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

jjc_card_game-0.0.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file jjc-card-game-0.0.1.tar.gz.

File metadata

  • Download URL: jjc-card-game-0.0.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for jjc-card-game-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3de5c2035c7d57998732070ce095d503334e065deb67e33dc46550be64b458c4
MD5 a6d1a24c2cf96b9517cf501975117894
BLAKE2b-256 821b6876720abf465831561f80f54b7ae3b981058c0bf2614aced85d8e16a5a1

See more details on using hashes here.

File details

Details for the file jjc_card_game-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: jjc_card_game-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for jjc_card_game-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd133627c8e079a4b689c613be37d7bea665cf91be53409d326fb768cdb57399
MD5 a9a0cd752217af634c5d2e9ed883f5e0
BLAKE2b-256 5259f4233d89bdba4b70bca3d7b4df3c7ff0475e486239cb1e3281ba18383c60

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.3

2 files

0.0.2

2 files

This release

0.0.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page