Add Spider game variant - #48
Merged
Merged
Conversation
two decks across ten piles with 1/2/4-suit difficulty, ten-card stock deals, automatic run banking, classic scoring plus the time bonus, per-suit-count high scores, and a cached-line planner measured at 95/49/3 percent win rates by the hint probe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21
What Changed
Add Spider game variant: two decks (104 cards) across ten tableau piles, with 1/2/4-suit difficulty selectable in Settings. Single cards land on any card one rank higher; groups move only as same-suit descending runs; the stock deals ten cards at once and is blocked over empty piles; completed King-to-Ace runs bank automatically to eight foundation piles, and one undo restores a full deal or banked run atomically. Scoring is classic Spider (start 500, −1 per move, +100 per run) plus the standard time bonus, with per-suit-count high scores.
Hints come from a new
SpiderPlanner(cached-line best-first search, Yukon-style) that can plan through stock deals and falls back to a fill-then-deal preparation line when the tableau is stuck.Shared-model extensions: variant capability properties on
GameVariant, variant-parameterized persistence validation with deck-composition multiset checks, a destination-effects hook inAutoMoveAdvisorso simulation banks runs identically to real play, and adealTableauRowundo action. The hint probe gains a Spider mode with recorded baselines.Why
Spider is the most-requested classic variant (#21). Implementing it required genuinely extending shared invariants (single 52-card deck, four foundations, Klondike-shaped stock) rather than just adding switch arms, so those seams are now variant-driven and validated per variant.
Validation
tools/hint-probe/run.sh spider 500: 95.4% / 49.2% / 2.8% hint-following win rates (1/2/4 suits), random controls 0.0%, zero stalemate-loops; Klondike and FreeCell baselines reproduce exactly. Baselines and tuning dead-ends recorded in the probe README.UI Changes
New Spider board: stock pile plus eight banked-run piles in the top row over ten columns; suit-count picker in Settings; Spider sections in Statistics and Rules & Scoring; new App Store screenshot fixture.