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
Release files for fatecast 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fatecast-0.1.0.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fatecast-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.3 kB
Release files / fatecast-0.1.0.tar.gz
| Download URL | fatecast-0.1.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e85c466706cedfb40fd485f4bfad2d1c256e211411c6b68ee30496498802657a
|
|
BLAKE2b-256 checksum How to use checksums |
88af6765940f5fd6f860da4b4534dec10d26c7bb31325cc8ff1e7bcfb012ba5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.13
|
Release files / fatecast-0.1.0-py3-none-any.whl
| Download URL | fatecast-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba1ef2d02e0d809b8d4af43791b2d057528737544ab614a6d498a61c090472ad
|
|
BLAKE2b-256 checksum How to use checksums |
e3674f582a00a6a97f20c27ed7b5196589838eeed12cf00e4975c15f07f33e8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.13
|