Skip to main content

Texas Hold'Em Lava Dome — terminal version

The third sibling to web/ (adenosine, browser) and wii/ (magnolia, C99). Runs entirely in a shell — no graphics, just characters.

Solo Hold'Em with no opponent. The dome charges an escalating ante each round and scores your hand against a threshold that climbs with it. Beat it and the stake comes back with a multiplier; miss and it is gone. Between hands you choose to bank chips — safe, and the bank is your score — or leave them in play for the next ante to eat.

pipx install magmacrunch-thld
lava-dome

pipx rather than pip because it puts the command on your PATH in its own virtualenv; plain pip install only reaches your PATH inside an activated venv. It is also a cabinet in the magmacrunch arcade — pipx install magmacrunch gets this and the other two — and plays identically either way.

For working on it:

pip install -e ".[dev]"
python -m lavadome        # or the installed `lava-dome` command
python -m lavadome --play           # skip the title screen
python -m lavadome --seed 42        # a reproducible shuffle
python -m lavadome --ascii          # plain ASCII throughout, for fonts
                                    # without ♥♦♣♠ — or ▲▼, or ░

Published as magmacrunch-thld — prefixed for the same reason as magmacrunch-george-boole; see that repo's PACKAGING.md. The import package stays plain lavadome.

Keys

← → adjust the bet
14 quick bet amounts
B / C bet / check for free (pre-flop)
Space take the next card
R / F raise / fold
K, 14 bank all / bank some
W withdraw from the bank
N / E next round / escape with what you banked
H, Esc, Q help, back, quit
Esc (title screen) back to the arcade, when the arcade started this

A raise buys the next card, so a hand holds four betting decisions and never more. That is the web build's behaviour and the Wii port's; letting a raise stay on its street would be an open betting loop, which is a longer and different game.

Needs a terminal at least 58x22.

When the terminal cannot draw the glyphs

Not every console can encode what these games draw. Windows' two common codepages are the ones that bite: cp1252 has none of the block elements, arrows or suits, and cp437 has the blocks and none of the arrows, stars or suits. The engine asks the terminal what it can encode and substitutes what it cannot, one group at a time -- so a set of related glyphs never comes back half translated, and a terminal that can draw the blocks keeps them even though it has lost the arrows.

Detection is automatic. Two ways to override it, for the case no probe can see -- an encoding that accepts the character in a font that has no picture for it:

lavadome --ascii              this game, this run
MAGMACRUNCH_ASCII=1      every cabinet, always

Every substitute is exactly one cell wide, so a plain screen has the same layout as a fancy one rather than a reflowed approximation of it.

--ascii used to mean the suits and only the suits, which left the bet meter's ▲▼ and the dome's unhandled on exactly the terminals the flag existed for. It now means the whole screen. The suits come out the same H/D/C/S by either route, and a test in each repo keeps them agreeing.

High scores

Kept on disk, so a record outlives the session. Filed under solitaire-thld — the key the browser build has used since before the rename — and recording the same quantity the browser does: total wealth, chips + bank, not the bank alone. Filing a different number under the same name is the sort of thing nobody notices until the numbers are wrong.

The moment that counts is leaving the dome, not losing a hand. Both ways out reach it: escaping banks the chips, and busting on the ante keeps whatever was banked already. Each entry keeps the rounds survived and whether you got out, the same two extras the browser stores.

Launchable by an arcade

The game declares itself through an entry point, so anything enumerating magmacrunch.games finds it:

[project.entry-points."magmacrunch.games"]
thld = "lavadome.arcade:GAME"

It does not own the terminal. A magmacrunch.engine.core.tui_host.TuiHost does, and LavaDomeApp is handed one — which is what lets the same code run as its own command and be seated by a launcher without knowing which happened. Esc from the title screen ends a standalone session and returns to the arcade menu under a launcher; the game just pops a scene and the host decides what that means.

How it is built

lavadome/
  cards.py     Card and Deck — ace-high, no rendering
  handeval.py  the poker evaluator
  config.py    the tuned numbers: antes, thresholds, payouts
  state.py     session and round state
  dealer.py    the deck and the four streets
  dome.py      ante, resolution, bust and escape
  betting.py   bet sizing, raises, banking
  theme.py     palette and card drawing, in character cells
  scenes.py    TitleScene, RulesScene, GameScene
  app.py       wiring: the game, the renderer, the scene stack

Everything above theme.py imports nothing outside the standard library — not the engine, not Textual. A test enforces it. The engine is magmacrunch.engine, which arrives with the magmacrunch package this one depends on, and the game draws through its Renderer/UISurface protocols rather than against Textual, so the planned hand-written ANSI backend will be a swap and not a rewrite.

Modality is the scene stack, not a flag: TitleScene sits at the bottom, a run pushes over it, and the rules screen pushes over whichever is showing.

Verifying the evaluator

The web build has no test suite — the Wii port's README calls that out as a problem, since it means the rules cannot be checked by agreeing with a reference.

tools/js_oracle.mjs stands in for one. It loads the actual shipped arcade/shared/adenosine-cards.js bundle in node, and tests/test_handeval.py runs both evaluators over thousands of random hands, comparing name, rank, points, tiebreakers and description on every one. That is the same method web/js/config.js records using when AdCards replaced this game's original evaluator: "Verified behaviourally identical over 20,000 random 2-7 card hands."

Those tests skip when node is absent; the hand-written cases still run.

Deliberate differences from web/

Both match what the Wii port already does, and both are recorded in wii/README.md.

  • Aces are high at construction, so there is no restamp step to forget. The web build deals from an ace-low Deck and restamps every card in Dealer._draw(), because the evaluator reads value off a card and never rewrites it. Get this wrong and a royal flush grades as an ordinary flush.
  • No burn cards. The web build discards one before the flop, turn and river. Off a freshly shuffled deck that cannot move any odds. It would matter only for replaying a seed against the browser, which is impossible anyway — the two use different random number generators.

One further difference, which is a fix rather than a taste call:

  • Hands resolve on the phase transition, not during a render. The web build calls resolveHand() from _phaseResolve(), a render function, and gets away with it only because resolving moves the phase on. A terminal redraws on every resize, so awarding chips from a render would be a live bug here.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magmacrunch_thld-0.5.0.tar.gz (50.5 kB view details)

Uploaded Source

Built Distribution

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

magmacrunch_thld-0.5.0-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

Details for the file magmacrunch_thld-0.5.0.tar.gz.

File metadata

  • Download URL: magmacrunch_thld-0.5.0.tar.gz
  • Upload date:
  • Size: 50.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for magmacrunch_thld-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a11dad495326436c152c3d19e51ca4beab6f092d88c7e66a24cfa8811be24cd9
MD5 17ca95fbed66393c1a7fd0ba033bef26
BLAKE2b-256 2650aa163db1adff8166b535809998cde910e81db2eeee35da009d5b6e52e34d

See more details on using hashes here.

Provenance

The following attestation bundles were made for magmacrunch_thld-0.5.0.tar.gz:

Publisher: release.yml on magmacrunch-media/texas-holdem-lava-dome

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

File details

Details for the file magmacrunch_thld-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for magmacrunch_thld-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e787de6f8e0e541b95be04b0d055a5c4aab87287fab1a29995abab9fae5557b6
MD5 ab6201402e83791af245fdc5df5935a8
BLAKE2b-256 bb12c4a98195bdf30d114e1e3fece7c72345bfc5835c33787990fef24b2c0d2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for magmacrunch_thld-0.5.0-py3-none-any.whl:

Publisher: release.yml on magmacrunch-media/texas-holdem-lava-dome

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

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page