Skip to content

1.16 part 7/18: Games: new solitaires and family card games, Courtier and the card table - #178

Closed
epheterson wants to merge 1 commit into
line/1.16.0-06-games-shellfrom
line/1.16.0-07-games-cards
Closed

epheterson wants to merge 1 commit into
line/1.16.0-06-games-shellfrom
line/1.16.0-07-games-cards

Conversation

@epheterson

@epheterson epheterson commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Part 7 of 18 of Zimi 1.16.0: Games: new solitaires and family card games, Courtier and the card table. Base: line/1.16.0-06-games-shell (part 6); the diff shows only this part's files. The PR carries the not-a-release label and the version stays 1.15.7, so merging it cuts no release. Merge in order (1 to 17, then 18) with a merge commit, not a squash.

What this is

The card games of ZimiGames: ten new solitaires, five family card games, Courtier, and the shared card code under all of them. The deck gets a new French face, and the card table gets wide and short-screen layouts and a picture of the table for the shelf. The 16 card rows in games.json (part 6) get their pages here.

What changes

  • solkit.js: the shared kit for tableau solitaires. A game is a few facts (what builds on what, what may be picked up, what fills an empty column); the moves, tap, hint, stuck sheet and win are written once.
  • yukon, fortythieves, canfield, scorpion, beleaguered, eightoff are each a small .js and .html over solkit.js. acesup, accordion, calculation and montecarlo are the other four solitaires; they also use solkit.js (state, cards, layout), with rules of their own in each file.
  • gofish.js, oldmaid.js, snap.js, ohhell.js, cheat.js: pure rules (no DOM, testable in node) followed by the page. Computers remember what was asked or caught. Snap's computer reacts at a spread of times and sometimes misses a match.
  • courtier.js, courtier.css, courtier.html: sixteen cards in eight ranks of the court, with the rules and the computer as pure functions, then the page (620 lines).
  • cards.js (+200, -69): a new French face, drawn as paths with no font; two index layouts (zc-ix-row for fanned piles, zc-ix-col for sideways hands); court figures framed; a fan step that never covers the index. cards.css, cards2.css, cardbacks.js and courts.js go with it.
  • solitaire.js: a wide layout puts stock over waste on the left and foundations two by two on the right; face-down cards show a fixed share of the height.
  • cardtable.js and cardtable.css: seat positions for five players, a short-table mode for a phone on its side, and an option that keeps the tray out of the middle of a short table.
  • tablesnap.js: paints the table's elements as a small svg so the shelf can show a game left under way. shell.js (part 6) loads it on demand.
  • Fixtures under tests/fixtures/games_solitaire and games_tricks are updated to the new deal and layout.

How to review

  • Start with solkit.js (the facts a game supplies and what the kit does with them), then cards.js (the face geometry and fan limits), then courtier.js (the rules at the top, which a node test drives).
  • Risk: the layout math in cards.js and cardtable.js (a card off screen on a phone, 390 by 844 and on its side); tablesnap.js reads the live DOM and gives up above MAX_CHARS; cheat.js and snap.js hold timed computer play.
  • Skip: the ten solitaire .html pages are the same 30 lines; the fixtures are recorded game states.
  • The served Games ZIM between parts 6 and 10 is the previous build; the source folder is ahead of it. The built ZIM lands once, in a commit of its own on top of part 10.
  • Rides here: tests/test_bake_cards_gate.py opens every card game on the shelf; it reads games.json rows added in 1.16. The new .css files carry generated Red blocks; the generator lands in part 9.

Tests

  • Rules in node: test_games_courtier.cjs, test_games_family_cards.cjs, test_games_solitaire_variants.cjs, test_games_cards.cjs (deal, scoring, undo).
  • Every card game at 390 by 844: test_bake_cards_gate.py opens, deals, takes one tap, checks nothing overflows and every card is on screen.
  • Variants and families: test_games_solitaire_variants_browser.py, test_games_family_cards_browser.py, test_games_ohhell_five_browser.py, test_games_courtier_browser.py.
  • Layout: test_games_cascade_fan_browser.py, test_games_fans_all_browser.py, test_games_court_fill_browser.py, test_games_climbing_status_browser.py.
  • Stuck play: test_games_stuck_after_stock_browser.py, test_games_stuck_sheets_browser.py; the shelf picture: test_games_table_snap_browser.py.
  • Most of these files are browser tests and run in the whole matrix, not this PR's quick tier.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@epheterson epheterson added the not-a-release Ships nothing; CI skips the version check label Nov 23, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Sorry @epheterson, your pull request is larger than the review limit of 150,000 diff characters

@epheterson epheterson mentioned this pull request Nov 23, 2026
@epheterson
epheterson force-pushed the line/1.16.0-06-games-shell branch from a62cf60 to 466db92 Compare November 23, 2026 10:07
@epheterson
epheterson force-pushed the line/1.16.0-07-games-cards branch from 3d6d392 to a12ffc1 Compare November 23, 2026 10:07
@epheterson
epheterson force-pushed the line/1.16.0-06-games-shell branch from 466db92 to 5ecfc10 Compare November 23, 2026 10:51
@epheterson
epheterson force-pushed the line/1.16.0-07-games-cards branch from a12ffc1 to d157b69 Compare November 23, 2026 10:51
@epheterson
epheterson force-pushed the line/1.16.0-06-games-shell branch from 5ecfc10 to 5d1459a Compare November 23, 2026 16:37
@epheterson
epheterson force-pushed the line/1.16.0-07-games-cards branch from d157b69 to ce77970 Compare November 23, 2026 16:37
@epheterson
epheterson force-pushed the line/1.16.0-06-games-shell branch from 5d1459a to 77c8a8e Compare November 23, 2026 16:44
@epheterson
epheterson force-pushed the line/1.16.0-07-games-cards branch from ce77970 to 0ca2233 Compare November 23, 2026 16:44
@epheterson

Copy link
Copy Markdown
Owner Author

Reviewed here; included in the release PR #189.

@epheterson epheterson closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not-a-release Ships nothing; CI skips the version check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant