Skip to main content

Command-line SQUABBLE — a familiar-seeming but legally distinct word game

Project description

Python command-line SQUABBLE

A familiar-seeming but legally distinct word game for the terminal: local hot-seat play or computer opponents that search the move space each turn.

Squabble demo

Requirements

  • Python 3.12+
  • uv (recommended) or pip

Setup

From the repository root:

uv sync

Or with pip:

python3 -m pip install -e .

Copy .env.example to .env if you need to override where data files live (see Data files below).

Data files

Dictionary and tile data are loaded from the directory pointed to by DATA_ROOT. If unset, it defaults to game/data next to the installed package (the usual layout in this repo).

You can set DATA_ROOT in a .env file at the project root (loaded automatically via python-dotenv) or export it in your shell.

Run the game

uv run squabble
uv run squabble <human_players> <computer_players>

Or:

python3 -m game
python3 game_manager.py

Moves (human)

  • quit — leave the game
  • skip — pass the turn
  • exchange <LETTERS> — trade tiles (when bag rules allow)
  • define <WORD> — look up a definition (when available)
  • <x> <y> <R|D> <WORD> — play at column x, row y, direction right or down (coordinates use the same hex digit column headers as the printed board)

Development

uv run pytest
uv run mypy game tests

Type checking targets the game package and tests with strict defaults (pyproject.toml).

Layout

  • game/cli.py — entry point and argument parsing
  • game/board.py — board state
  • game/rulebook.py — dictionary, scoring, validation
  • game/tile_bag.py — tile pool
  • game/game_master.py — turn loop and scoring
  • game/players/ — human and computer players
  • game/ui/ — rendering, panels, and display logic (includes deliberate animation delays for readability)
  • game/paths.pyDATA_ROOT / data_path()
  • game/types.py — shared type definitions
  • tests/ — pytest suite

The AI move search is fast enough that two computer players can complete multiple full games per second when run without the UI layer.

Credits

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

squabble_game-0.1.0.tar.gz (6.7 MB view details)

Uploaded Source

Built Distribution

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

squabble_game-0.1.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file squabble_game-0.1.0.tar.gz.

File metadata

  • Download URL: squabble_game-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for squabble_game-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1ed224bd0a3d58e35f166d74d8aa8aa99af002cab166f5aef479cb9675b53cf8
MD5 f1874e87324484023c3e2ee1fb0c1bba
BLAKE2b-256 1aa04421724a9f8c2492391cdcdd01a5a9e5f31a49245bf7b15d71f8028698a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for squabble_game-0.1.0.tar.gz:

Publisher: release.yml on klingj3/squabble-word-game

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

File details

Details for the file squabble_game-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: squabble_game-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for squabble_game-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49a74cce29cefcf769ce1a806405866686f991d5edec89477c2f54800886915f
MD5 da5729079fd49f4310e4753b2501abe6
BLAKE2b-256 84583a7bf3c1a3bece6fc008d95e3a1120a48e3bea662d59398d6082ed8710cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for squabble_game-0.1.0-py3-none-any.whl:

Publisher: release.yml on klingj3/squabble-word-game

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