Solitaire (terminal)
The magmacrunch arcade's Solitaire, Klondike draw three, in a terminal. It is
the second version of the game, beside web/. It runs on the
magmacrunch engine's
terminal backend, either as a cabinet in the magmacrunch arcade or as its own
command, and plays the same either way.
pipx install magmacrunch-solitaire
solitaire # the title
solitaire --play --seed 7 # straight to a deal, the same deals every time
For working on it, from this folder, once the website's shared/ is linked
in beside web/ (node tools/link-shared.mjs from the repository's root),
which the oracle test needs:
pip install -e ".[dev]"
python -m klondike
Keys
A cursor stands for the mouse, and ENTER is a click wherever it stands.
| key | |
|---|---|
← → |
along the top row (stock, waste, foundations) or across the columns |
↑ ↓ |
up and down a column's face-up cards, and between the top row and the columns |
1 to 7 |
a column |
ENTER SPACE |
click: draw from the stock, pick a card up, or put the held card there |
F |
double-click: a card to its foundation, if it can go |
D |
draw, wherever the cursor is |
X |
click the felt: put the held card down |
N |
deal again |
H S |
help, the scores; the clock stops while they are open |
Esc Esc |
leave the deal, for the title (and from there, the arcade) |
Q |
quit |
The stock shows its back and how many cards are left. The waste shows its top three, fanned. A column shows its face-down cards as one back and a count, then its face-up cards one to a row. The held card is lit cyan and the cursor pink. A win shows the page's win screen: time, moves, score, and the time bonus, with a NEW HIGH SCORE badge when the score makes the board. It goes on the board with its time beside it, as the page saves it.
Needs a 41x24 terminal.
It is the browser's game, on the browser's clock
klondike/rules.py is web/js/game.js, method for method, with the deck and
its shuffle from the website's shared/adenosine-cards.js. The page keeps
its time with a one-second setInterval, and that is part of the rules: the
time on the table, and the bonus a win is paid, are whatever that timer last
set. So the port keeps the page's clock too. Its time only moves when the
screen moves it, by the real time gone, and the interval fires at each of
its seconds on the way. A double click is two clicks on one card inside
300 ms of that time. Two tests hold the port to the page:
tests/test_oracle.py.tools/js_oracle.mjsloads those files unmodified on a page that does nothing, with a seededMath.randomand a clock of its own. It plays 40 games through theSolitaireclass the way the page's clicks reach it: the stock, a card, an empty foundation or column, the felt, the menu's pauses and New. Half are a random clicker that now and then clicks the same card again quickly. Half are a greedy player, which won 16 of its 285 deals. That is 134,958 clicks and clock steps. The test makes the same ones through the port and requires the same state after every one: every pile, face up or down, the card held and where from, moves, score, the seconds on the clock, whether it runs, and the win screens set going. Widening the double click to 310 ms fails it at seed 1, event 266; a bonus of x36 fails it at seed 2, event 3,194.tests/test_rules.py. It sets up by hand the cases worth pinning, including the fixes below, so that undoing one shows as a change.
Fixed in both
- Only a column's top card goes to a foundation. The page checked the card picked and moved the column's top card: with the 5♥ and 4♠ face up and the hearts at 4, picking the 5♥ put the 4♠ on the hearts. Now nothing moves.
- A card on a foundation stays there. Moving one to another foundation counted a move and moved nothing; now it counts nothing.
- A won table is finished. It still played: a king taken off its foundation and put back won again, with a second bonus and a second score. A win now stops the clock for good, and Help and the scores no longer start it again.
- The bonus is paid on the time to the win, read at the winning move, not on the timer's last tick up to a second before it. A win under 30 seconds is paid as 30, so the bonus never falls as a win gets faster: it was 24,500,000 at one second and nothing under one.
- The clock holds for every reason at once. A modal and the page being hidden each hold it, and it runs again only once neither does. A new deal starts it clean, and drops a win screen still waiting from the last deal.
- A draw puts down a waste card held. The page kept it held by its old
place on the waste, so the next move took whatever card the draw had put
there. Worse, holding the waste's king, turning the waste back into the
stock and clicking an empty column pushed
undefinedinto the column, and every render after threw: in Chromium, "Cannot read properties of undefined (reading 'getHTML')", and the table stopped answering clicks.drawFromStockanddraw_from_stocknow put a held waste card down first; a tableau card held stays held. In Chromium the same clicks on the fixed page leave the column empty, and the king, drawn again, goes there. Taking the fix out of the port alone fails the oracle at seed 1, event 252; the trace has 57 draws with a waste card held, three of them turn-overs.
Licence
PolyForm Noncommercial 1.0.0, as for the rest of this repository. See
LICENSE and NOTICE.
Metadata
Release files for magmacrunch-solitaire 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| magmacrunch_solitaire-0.1.2.tar.gz | 26.0 kB | With provenance | Details for magmacrunch_solitaire-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| magmacrunch_solitaire-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for magmacrunch_solitaire-0.1.2-py3-none-any.whl |
Total release size: 47.7 kB
Release files / magmacrunch_solitaire-0.1.2.tar.gz
| Download URL | magmacrunch_solitaire-0.1.2.tar.gz |
|---|---|
| Size | 26.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
500560370272af783c5d060c2e3bcb2e59cf7bf461fd77ea3f78204c7b1c3808
|
|
BLAKE2b-256 checksum How to use checksums |
511e3413d1ac4c2167ff4db55734e48f0b851d8433bd9a1a4f172dcd6d9ac7a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / magmacrunch_solitaire-0.1.2-py3-none-any.whl
| Download URL | magmacrunch_solitaire-0.1.2-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1653e2bc63c09383d2250d5f002bcf74023785fb1cb060fec4ead03e24a37d5a
|
|
BLAKE2b-256 checksum How to use checksums |
a7093518e2ebb79f8687b67c567c51ad138576087881f0b6c69d8d67fb65e124
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for magmacrunch-solitaire 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for magmacrunch_solitaire-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.