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)
- 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
- 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"
- 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 cupsr: reset statsq: 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 rogvibeworks out of the box. If fatecast is ever published,uvx fatecastwould 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e85c466706cedfb40fd485f4bfad2d1c256e211411c6b68ee30496498802657a
|
|
| MD5 |
52f87b6242d66df8534ec3f38fa11867
|
|
| BLAKE2b-256 |
88af6765940f5fd6f860da4b4534dec10d26c7bb31325cc8ff1e7bcfb012ba5e
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba1ef2d02e0d809b8d4af43791b2d057528737544ab614a6d498a61c090472ad
|
|
| MD5 |
03fd6de7e80b7f3daf0524e12052edf0
|
|
| BLAKE2b-256 |
e3674f582a00a6a97f20c27ed7b5196589838eeed12cf00e4975c15f07f33e8e
|