From 9c72f9f215a15054669476def05c39fe1b5a662a Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Mon, 30 Nov 2026 19:18:46 -0700 Subject: [PATCH] Allow Draw in Three Shuffles before shuffles are spent - `canDraw()` no longer requires `shufflesLeft === 0`, so the single Draw can be used at any point while buried cards remain. - Update status, float-text, and tutorial copy to describe Draw as always available instead of gated behind exhausting shuffles. - Adjust verification test to assert Draw is open with shuffles still remaining. --- src/games/solitairetour/SolitaireTourGame.js | 2 +- src/games/solitairetour/SolitaireTourLegs.js | 2 +- src/games/solitairetour/SolitaireTourLogic.js | 4 ++-- src/games/solitairetour/tutorial.md | 2 +- tools/verifySolitaireTour.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/games/solitairetour/SolitaireTourGame.js b/src/games/solitairetour/SolitaireTourGame.js index fc531b5..2d557af 100644 --- a/src/games/solitairetour/SolitaireTourGame.js +++ b/src/games/solitairetour/SolitaireTourGame.js @@ -447,7 +447,7 @@ export default class SolitaireTourGame extends SolitaireScene { toggleDraw() { if (!this.canAct() || this.legType !== 'threeshuffles') return; - if (!this.drawMode && !this.gs.canDraw()) { this.floatText({ x: PCX, y: 860 }, this.gs.shufflesLeft ? 'Use both shuffles before the Draw' : 'The Draw is spent', '#ffd2a0', { size: 20 }); return; } + if (!this.drawMode && !this.gs.canDraw()) { this.floatText({ x: PCX, y: 860 }, this.gs.drawsLeft ? 'No buried cards left to draw' : 'The Draw is spent', '#ffd2a0', { size: 20 }); return; } this.drawMode = !this.drawMode; this.selected = null; this.updateDock(); diff --git a/src/games/solitairetour/SolitaireTourLegs.js b/src/games/solitairetour/SolitaireTourLegs.js index 2cd25ad..80b4a74 100644 --- a/src/games/solitairetour/SolitaireTourLegs.js +++ b/src/games/solitairetour/SolitaireTourLegs.js @@ -458,7 +458,7 @@ export class ThreeShufflesLeg extends Leg { status() { const e = this.e; const home = SUITS.reduce((t, s) => t + e.foundations[s].length, 0); - return [`Shuffles left: ${e.shufflesLeft} · Draw: ${e.drawsLeft}`, `${home} of 52 cards home`, e.shufflesLeft ? 'Stuck? Shuffle gathers and redeals the fans' : (e.canDraw() ? 'Draw lifts one buried card free' : '')]; + return [`Shuffles left: ${e.shufflesLeft} · Draw: ${e.drawsLeft}`, `${home} of 52 cards home`, e.canDraw() ? 'Draw lifts one buried card free' : (e.shufflesLeft ? 'Stuck? Shuffle gathers and redeals the fans' : '')]; } } diff --git a/src/games/solitairetour/SolitaireTourLogic.js b/src/games/solitairetour/SolitaireTourLogic.js index 57e981d..232b121 100644 --- a/src/games/solitairetour/SolitaireTourLogic.js +++ b/src/games/solitairetour/SolitaireTourLogic.js @@ -357,7 +357,7 @@ export class KlondikeEngine { // fans of three. Four foundations build UP in suit; fans build DOWN in suit and // only the top card is in play. Empty spaces are never refilled. When stuck the // player gathers all fan cards, shuffles, and redeals — twice (the initial deal -// is the first of the three "shuffles"). After the redeals are spent, one Draw frees any single +// is the first of the three "shuffles"). At any time, one Draw frees any single // buried card. The reshuffle is seeded and the seed is part of the snapshot, // so undoing a shuffle and shuffling again gives the same cards. export class ThreeShufflesEngine { @@ -417,7 +417,7 @@ export class ThreeShufflesEngine { return !!card && !!top && top.suit === card.suit && card.pval === top.pval - 1; } - canDraw() { return this.shufflesLeft === 0 && this.drawsLeft > 0 && this.piles.some(p => p.length > 1); } + canDraw() { return this.drawsLeft > 0 && this.piles.some(p => p.length > 1); } apply(m) { let out = []; diff --git a/src/games/solitairetour/tutorial.md b/src/games/solitairetour/tutorial.md index 04dded4..2fd3c17 100644 --- a/src/games/solitairetour/tutorial.md +++ b/src/games/solitairetour/tutorial.md @@ -96,7 +96,7 @@ The four **aces start on the foundations**, and the remaining 48 cards are dealt - Only the **top card of a fan** plays. Fans build **down in the same suit** (the 6♥ goes on the 7♥). - **Empty spaces stay empty.** - When stuck, **Shuffle** (S): every fan card is gathered, shuffled and dealt out in threes again. You get **two** shuffles. -- Once both shuffles are used, you get one **Draw** (D): click any buried card to lift it free. +- At any point in the game you get one **Draw** (D): click any buried card to lift it free. --- diff --git a/tools/verifySolitaireTour.js b/tools/verifySolitaireTour.js index ed118f4..e4bec6a 100644 --- a/tools/verifySolitaireTour.js +++ b/tools/verifySolitaireTour.js @@ -150,7 +150,7 @@ section('Three Shuffles and a Draw'); ok('builds down in suit', e.canStack(C('7s'), 0) && !e.canStack(C('7h'), 0)); ok('empty spaces stay empty', !e.canStack(C('7h'), 3)); ok('ace goes home', e.apply({ t: 'tfound', p: 4 }).length === 1); - ok('no Draw before the shuffles are spent', !e.canDraw()); + ok('Draw is open even with shuffles left', e.canDraw()); // the reshuffle is seeded: undo + shuffle again gives the same fans const g = createEngine('threeshuffles', mulberry32(7)); const s0 = g.snapshot();