Skip to main content

A Textual-powered Chaoshan cup divination mini game.

Project description

Chaoshan Cup Divination Mini Game

This is a Textual-powered terminal toy that recreates the Chaoshan folk ritual of cup divination (also known as moon blocks or poe). Interact with the deity by tossing two cups and read the verdict instantly:

  • Press the Throw Cups button (or shortcuts) to perform a toss.
  • Outcomes:
    • Shengbei (Approval) – one cup face up and one face down → divine consent.
    • Yinbei (Laughing Cup) – both up or both down → ask again or show more sincerity.
    • Anger Cup – three Yinbei in a row counts as divine displeasure.
  • Hitting three Shengbei in a row unlocks a blessing banner.

Reference framework: Textual

Run It (Users)

  1. Install via PyPI (once released):
pip install fatecast

Or install from source (Python 3.10+ recommended):

pip install -r requirements.txt
# or just the essentials
pip install textual textual-dev
  1. Start the TUI:
python -m fatecast
# or, if installed as a CLI
fatecast
# run directly via textual (no entry script required)
textual run fatecast.ui:CupThrowApp
# serve over Textual Web
textual serve "python -m fatecast"
  1. Optional: open the Textual developer console from another terminal to watch logs.
textual console

Development

Editable install and tooling are recommended:

# install runtime + project in editable mode
pip install -e .

# dev helpers (formatting, lint, tests)
pip install -r requirements-dev.txt

Handy Makefile targets:

make run      # launch the app
make test     # run pytest
make lint     # ruff + mypy
make format   # black

Project Layout

fatecast/
  fatecast/
    __init__.py
    __main__.py
    cli.py        # CLI entry point
    logic.py      # cup rules & stats
    ui.py         # Textual interface
  tests/
    test_logic.py
  pyproject.toml
  requirements*.txt
  Makefile
  README.md

Shortcuts

  • t / space: throw cups
  • r: reset stats
  • q: quit

CLI Options

fatecast --seed 42 --anger-threshold 3

Inspiration

  • rogvibe: a Textual-based terminal raffle that demonstrates clean CLIs and multi-mode UX.
  • Textual: the framework powering this TUI.

Note: rogvibe is on PyPI, so uvx rogvibe works out of the box. If fatecast is ever published, uvx fatecast would offer the same experience.

Notes & Odds

  • Statistically, Shengbei and Yinbei each appear roughly half of the time (two favorable combinations out of four).
  • The anger meter follows a pragmatic rule: every 3 consecutive Yinbei trigger one anger count and reset the streak.
  • This project is for cultural interaction and entertainment only—no real divination is implied.

License

MIT

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

fatecast-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

fatecast-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fatecast-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.13

File hashes

Hashes for fatecast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e85c466706cedfb40fd485f4bfad2d1c256e211411c6b68ee30496498802657a
MD5 52f87b6242d66df8534ec3f38fa11867
BLAKE2b-256 88af6765940f5fd6f860da4b4534dec10d26c7bb31325cc8ff1e7bcfb012ba5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fatecast-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.13

File hashes

Hashes for fatecast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba1ef2d02e0d809b8d4af43791b2d057528737544ab614a6d498a61c090472ad
MD5 03fd6de7e80b7f3daf0524e12052edf0
BLAKE2b-256 e3674f582a00a6a97f20c27ed7b5196589838eeed12cf00e4975c15f07f33e8e

See more details on using hashes here.

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