Skip to main content

A professional-grade, colorful CLI Yahtzee game for 1-4 players

Project description

yahtzee-li (yaht-CLI)

PyPI version Python 3.12+ License: MIT

A professional-grade, colorful CLI Yahtzee game for 1–4 players, built in Python with rich.

Features

  • Full Yahtzee rule set: upper-section bonus (35 pts at ≥63), Yahtzee bonus (+100 per extra Yahtzee), and the official joker rule
  • Vivid terminal UI: ASCII-art dice panels, live multi-player scorecards, and a victory screen
  • 1–4 human players per game
  • "Play again" prompt after each game — keep the same players or start fresh

Requirements

  • Python 3.12+
  • uv (recommended) or any virtual-environment manager

Installation

From PyPI

pip install yahtzee-li

Or with uv:

uv tool install yahtzee-li

From source (development)

git clone https://github.com/carlmatt/yahtzee-li.git
cd yahtzee-li
uv sync

Running the game

# With uv / the project virtual environment
uv run yahtzee-li

# Or activate the venv first
source venv/bin/activate
yahtzee-li

Development

# Install dev dependencies
make install

# Run the game
make run

# Run the test suite
make test

# Run tests with coverage report
make test-cov

# Lint and format (combined)
make fix

# Lint only
make lint

# Format only
make format

# Lint + test
make check

# Remove cache and build artifacts
make clean

How to Play

  1. Enter the number of players (1–4) and each player's name.
  2. On each turn, all five dice are rolled automatically.
  3. After each roll you may hold any dice by entering their numbers (e.g. 1,3,5), press Enter to hold none, or enter d to skip straight to scoring.
  4. After up to three rolls, choose a scoring category from the numbered list.
  5. The game runs for 13 rounds; the player with the highest grand total wins.
  6. Press Ctrl-C at any time to quit.

Scoring Reference

Category Score
Ones – Sixes Sum of matching dice
Three of a Kind Sum of all dice (if ≥3 match)
Four of a Kind Sum of all dice (if ≥4 match)
Full House 25 pts
Small Straight 30 pts
Large Straight 40 pts
Yahtzee 50 pts
Chance Sum of all dice
Upper Bonus +35 if upper subtotal ≥ 63
Yahtzee Bonus +100 per extra Yahtzee

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

yahtzee_li-0.6.1.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

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

yahtzee_li-0.6.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file yahtzee_li-0.6.1.tar.gz.

File metadata

  • Download URL: yahtzee_li-0.6.1.tar.gz
  • Upload date:
  • Size: 42.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yahtzee_li-0.6.1.tar.gz
Algorithm Hash digest
SHA256 417edba42a1296855d6b64d917f31823bf3440608e8511d7e3cb9aead4f8ad74
MD5 c740e9fd302e71b881f78fc4c03cfb0f
BLAKE2b-256 a28d8dbf6c75265c694b5708dfee82604bdad97dab6b326ebeb4bd66570391ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for yahtzee_li-0.6.1.tar.gz:

Publisher: publish.yml on carlmatt/yahtzee-li

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yahtzee_li-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: yahtzee_li-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yahtzee_li-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 999982444b32eff51b7d521688fc18de50e6c39f0805ff56b3aa0cef1699e5e8
MD5 4334524f0a3086201f846d95eb672f62
BLAKE2b-256 6d0f87107d17cc4e0e8cf76e2d4bd3d53cd68dd6e304c33de6642677cf76aa07

See more details on using hashes here.

Provenance

The following attestation bundles were made for yahtzee_li-0.6.1-py3-none-any.whl:

Publisher: publish.yml on carlmatt/yahtzee-li

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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