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.
This commit is contained in:
Brian Fertig 2026-11-30 19:18:46 -07:00
parent 5ca7dce7a0
commit 9c72f9f215
No known key found for this signature in database
5 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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' : '')];
}
}

View File

@ -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 = [];

View File

@ -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.
---

View File

@ -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();