@tastic/cardtastic-engine 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +68 -2
  3. package/dist/acesup.d.mts +17 -0
  4. package/dist/acesup.d.ts +17 -0
  5. package/dist/acesup.js +8 -0
  6. package/dist/acesup.mjs +8 -0
  7. package/dist/autoFoundation-CfnFNysj.d.ts +63 -0
  8. package/dist/autoFoundation-Ctp9LKa-.d.mts +63 -0
  9. package/dist/canfield.d.mts +64 -0
  10. package/dist/canfield.d.ts +64 -0
  11. package/dist/canfield.js +20 -0
  12. package/dist/canfield.mjs +20 -0
  13. package/dist/chunk-22DC2YH6.js +95 -0
  14. package/dist/chunk-3BMUGHKQ.mjs +95 -0
  15. package/dist/chunk-4HJ7QMYV.mjs +339 -0
  16. package/dist/chunk-4WAWIFQF.js +131 -0
  17. package/dist/chunk-5266UC2Q.mjs +271 -0
  18. package/dist/chunk-6JWUTZVU.mjs +214 -0
  19. package/dist/chunk-AY3CR5EH.mjs +212 -0
  20. package/dist/chunk-B56TRALO.js +23 -0
  21. package/dist/chunk-CV3VJX34.mjs +341 -0
  22. package/dist/chunk-FDHHAPZA.mjs +177 -0
  23. package/dist/chunk-FTR733R7.mjs +297 -0
  24. package/dist/chunk-GFP5NUYK.mjs +23 -0
  25. package/dist/chunk-IKLYXDG7.mjs +131 -0
  26. package/dist/chunk-LH3UZP7D.js +165 -0
  27. package/dist/chunk-LSS44UKH.js +22 -0
  28. package/dist/chunk-M37CNJHF.mjs +165 -0
  29. package/dist/chunk-PLSNST56.mjs +163 -0
  30. package/dist/chunk-PTRHGPCN.js +163 -0
  31. package/dist/chunk-S3WNVF2K.js +339 -0
  32. package/dist/chunk-SDZPP3HI.mjs +22 -0
  33. package/dist/chunk-SLQ7RGMZ.js +212 -0
  34. package/dist/chunk-TNMFNWEM.mjs +249 -0
  35. package/dist/chunk-VGJPT3CX.js +214 -0
  36. package/dist/chunk-W5CPH6TD.js +115 -0
  37. package/dist/chunk-WJGEX74V.js +341 -0
  38. package/dist/chunk-WKES4P36.js +297 -0
  39. package/dist/chunk-XPTQNUF3.js +348 -0
  40. package/dist/chunk-XSS5M6C7.mjs +115 -0
  41. package/dist/chunk-XTHDUWJF.js +271 -0
  42. package/dist/chunk-XV5OUPIW.js +177 -0
  43. package/dist/chunk-YKY4K67K.mjs +348 -0
  44. package/dist/chunk-ZMNGTXU5.js +249 -0
  45. package/dist/fortythieves.d.mts +50 -0
  46. package/dist/fortythieves.d.ts +50 -0
  47. package/dist/fortythieves.js +22 -0
  48. package/dist/fortythieves.mjs +22 -0
  49. package/dist/freecell.d.mts +30 -0
  50. package/dist/freecell.d.ts +30 -0
  51. package/dist/freecell.js +18 -0
  52. package/dist/freecell.mjs +18 -0
  53. package/dist/gameTypes-BnfLkwzA.d.mts +201 -0
  54. package/dist/gameTypes-BnfLkwzA.d.ts +201 -0
  55. package/dist/golf.d.mts +17 -0
  56. package/dist/golf.d.ts +17 -0
  57. package/dist/golf.js +7 -0
  58. package/dist/golf.mjs +7 -0
  59. package/dist/index.d.mts +176 -0
  60. package/dist/index.d.ts +176 -0
  61. package/dist/index.js +446 -0
  62. package/dist/index.mjs +446 -0
  63. package/dist/klondike.d.mts +25 -0
  64. package/dist/klondike.d.ts +25 -0
  65. package/dist/klondike.js +15 -0
  66. package/dist/klondike.mjs +15 -0
  67. package/dist/pyramid.d.mts +36 -0
  68. package/dist/pyramid.d.ts +36 -0
  69. package/dist/pyramid.js +16 -0
  70. package/dist/pyramid.mjs +16 -0
  71. package/dist/scorpion.d.mts +14 -0
  72. package/dist/scorpion.d.ts +14 -0
  73. package/dist/scorpion.js +9 -0
  74. package/dist/scorpion.mjs +9 -0
  75. package/dist/spider.d.mts +22 -0
  76. package/dist/spider.d.ts +22 -0
  77. package/dist/spider.js +11 -0
  78. package/dist/spider.mjs +11 -0
  79. package/dist/tripeaks.d.mts +43 -0
  80. package/dist/tripeaks.d.ts +43 -0
  81. package/dist/tripeaks.js +19 -0
  82. package/dist/tripeaks.mjs +19 -0
  83. package/dist/yukon.d.mts +24 -0
  84. package/dist/yukon.d.ts +24 -0
  85. package/dist/yukon.js +15 -0
  86. package/dist/yukon.mjs +15 -0
  87. package/package.json +187 -4
@@ -0,0 +1,165 @@
1
+ import {
2
+ shuffledDeck,
3
+ top
4
+ } from "./chunk-XSS5M6C7.mjs";
5
+
6
+ // src/games/tripeaks/rules.ts
7
+ var ROW_WIDTHS = [3, 6, 9, 10];
8
+ var ROW_STARTS = [0, 3, 9, 18, 28];
9
+ var TOTAL = 28;
10
+ function flatIndex(row, col) {
11
+ return ROW_STARTS[row] + col;
12
+ }
13
+ function rowColOf(index) {
14
+ let row = 0;
15
+ while (ROW_STARTS[row + 1] <= index) row++;
16
+ return { row, col: index - ROW_STARTS[row] };
17
+ }
18
+ function childIndices(row, col) {
19
+ if (row === 3) return null;
20
+ if (row === 0) {
21
+ return [flatIndex(1, col * 2), flatIndex(1, col * 2 + 1)];
22
+ }
23
+ if (row === 1) {
24
+ const peak2 = Math.floor(col / 2);
25
+ const local2 = col % 2;
26
+ const base2 = peak2 * 3 + local2;
27
+ return [flatIndex(2, base2), flatIndex(2, base2 + 1)];
28
+ }
29
+ const peak = Math.floor(col / 3);
30
+ const local = col % 3;
31
+ const base = peak * 3 + local;
32
+ return [flatIndex(3, base), flatIndex(3, base + 1)];
33
+ }
34
+ function isExposed(tableau, row, col) {
35
+ const idx = flatIndex(row, col);
36
+ if (!tableau[idx]) return false;
37
+ const children = childIndices(row, col);
38
+ if (!children) return true;
39
+ const [a, b] = children;
40
+ return !tableau[a] && !tableau[b];
41
+ }
42
+ function isExposedAt(tableau, index) {
43
+ const { row, col } = rowColOf(index);
44
+ return isExposed(tableau, row, col);
45
+ }
46
+ function countNewlyExposed(tableau, index) {
47
+ const after = tableau.slice();
48
+ after[index] = null;
49
+ let count = 0;
50
+ for (let i = 0; i < TOTAL; i++) {
51
+ if (i === index || !after[i]) continue;
52
+ if (!isExposedAt(tableau, i) && isExposedAt(after, i)) count++;
53
+ }
54
+ return count;
55
+ }
56
+ function scoreHintMove(state, move) {
57
+ if (move.from.zone !== "tableau" || move.to.zone !== "waste") return 0;
58
+ return 1 + countNewlyExposed(state.tableau, move.from.index);
59
+ }
60
+ function isAdjacentRank(a, b, wrapAceKing) {
61
+ if (Math.abs(a.rank - b.rank) === 1) return true;
62
+ return wrapAceKing && (a.rank === 1 && b.rank === 13 || a.rank === 13 && b.rank === 1);
63
+ }
64
+ function cloneState(state) {
65
+ return {
66
+ tableau: state.tableau,
67
+ waste: state.waste,
68
+ stock: state.stock
69
+ };
70
+ }
71
+ function newGame(seed) {
72
+ const deck = shuffledDeck(seed, 1);
73
+ const tableau = deck.slice(0, TOTAL).map((c) => ({ ...c, faceUp: true }));
74
+ const starter = deck[TOTAL];
75
+ const waste = [{ ...starter, faceUp: true }];
76
+ const stock = deck.slice(TOTAL + 1).map((c) => ({ ...c, faceUp: false }));
77
+ return { tableau, waste, stock };
78
+ }
79
+ function cardAt(state, ref) {
80
+ if (ref.zone === "tableau") return state.tableau[ref.index] ?? null;
81
+ if (ref.zone === "waste") return top(state.waste) ?? null;
82
+ return null;
83
+ }
84
+ function drawStock(state) {
85
+ if (state.stock.length === 0) return null;
86
+ const next = cloneState(state);
87
+ const nextStock = next.stock.slice();
88
+ const nextWaste = next.waste.slice();
89
+ const card = nextStock.pop();
90
+ nextWaste.push(card.faceUp ? card : { ...card, faceUp: true });
91
+ next.stock = nextStock;
92
+ next.waste = nextWaste;
93
+ return next;
94
+ }
95
+ function isWon(state) {
96
+ return state.tableau.every((c) => c === null);
97
+ }
98
+ function createTriPeaksController(wrapAceKing) {
99
+ function tryMove(state, move) {
100
+ const { from, to, count } = move;
101
+ if (count !== 1) return null;
102
+ if (from.zone !== "tableau") return null;
103
+ if (to.zone !== "waste" || to.index !== 0) return null;
104
+ const card = state.tableau[from.index];
105
+ if (!card) return null;
106
+ if (!isExposedAt(state.tableau, from.index)) return null;
107
+ const wasteTop = top(state.waste);
108
+ if (!wasteTop) return null;
109
+ if (!isAdjacentRank(card, wasteTop, wrapAceKing)) return null;
110
+ const next = cloneState(state);
111
+ const nextTableau = next.tableau.slice();
112
+ const nextWaste = next.waste.slice();
113
+ nextTableau[from.index] = null;
114
+ nextWaste.push(card);
115
+ next.tableau = nextTableau;
116
+ next.waste = nextWaste;
117
+ return next;
118
+ }
119
+ function legalMoves(state) {
120
+ const moves = [];
121
+ const wasteTop = top(state.waste);
122
+ if (!wasteTop) return moves;
123
+ for (let i = 0; i < TOTAL; i++) {
124
+ const card = state.tableau[i];
125
+ if (card && isExposedAt(state.tableau, i) && isAdjacentRank(card, wasteTop, wrapAceKing)) {
126
+ moves.push({ from: { zone: "tableau", index: i }, to: { zone: "waste", index: 0 }, count: 1 });
127
+ }
128
+ }
129
+ return moves;
130
+ }
131
+ function isStuck(state) {
132
+ return !isWon(state) && state.stock.length === 0 && legalMoves(state).length === 0;
133
+ }
134
+ function autoMoveHint(state, from, cardId) {
135
+ if (from.zone !== "tableau") return null;
136
+ const card = state.tableau[from.index];
137
+ if (!card || card.id !== cardId) return null;
138
+ if (!isExposedAt(state.tableau, from.index)) return null;
139
+ const wasteTop = top(state.waste);
140
+ if (!wasteTop || !isAdjacentRank(card, wasteTop, wrapAceKing)) return null;
141
+ return { from, to: { zone: "waste", index: 0 }, count: 1 };
142
+ }
143
+ return {
144
+ id: "tripeaks",
145
+ title: "TriPeaks",
146
+ newGame,
147
+ legalMoves,
148
+ tryMove,
149
+ drawStock,
150
+ isWon,
151
+ isStuck,
152
+ autoMoveHint,
153
+ scoreHintMove
154
+ };
155
+ }
156
+
157
+ export {
158
+ ROW_WIDTHS,
159
+ flatIndex,
160
+ rowColOf,
161
+ childIndices,
162
+ isExposed,
163
+ cardAt,
164
+ createTriPeaksController
165
+ };
@@ -0,0 +1,163 @@
1
+ import {
2
+ allDestinations,
3
+ columnsKey
4
+ } from "./chunk-FDHHAPZA.mjs";
5
+ import {
6
+ shuffledDeck,
7
+ top
8
+ } from "./chunk-XSS5M6C7.mjs";
9
+
10
+ // src/games/acesup/rules.ts
11
+ var NUM_PILES = 4;
12
+ function effectiveRank(card) {
13
+ return card.rank === 1 ? 14 : card.rank;
14
+ }
15
+ function cloneState(state) {
16
+ return {
17
+ piles: state.piles.slice(),
18
+ stock: state.stock,
19
+ discard: state.discard
20
+ };
21
+ }
22
+ function setPile(state, ref, pile) {
23
+ switch (ref.zone) {
24
+ case "tableau":
25
+ state.piles[ref.index] = pile;
26
+ break;
27
+ case "stock":
28
+ state.stock = pile;
29
+ break;
30
+ case "discard":
31
+ state.discard = pile;
32
+ break;
33
+ }
34
+ }
35
+ function canDiscard(piles, pileIndex) {
36
+ const card = top(piles[pileIndex]);
37
+ if (!card) return false;
38
+ return piles.some((p, i) => {
39
+ if (i === pileIndex) return false;
40
+ const other = top(p);
41
+ return !!other && other.suit === card.suit && effectiveRank(other) > effectiveRank(card);
42
+ });
43
+ }
44
+ function canMoveToEmpty(piles, fromIndex, toIndex) {
45
+ if (fromIndex === toIndex) return false;
46
+ if (piles[fromIndex].length === 0) return false;
47
+ return piles[toIndex].length === 0;
48
+ }
49
+ function newGame(seed) {
50
+ const deck = shuffledDeck(seed, 1);
51
+ const piles = Array.from({ length: NUM_PILES }, () => []);
52
+ for (let i = 0; i < NUM_PILES; i++) {
53
+ piles[i].push({ ...deck[i], faceUp: true });
54
+ }
55
+ const stock = deck.slice(NUM_PILES).map((c) => ({ ...c, faceUp: false }));
56
+ return { piles, stock, discard: [] };
57
+ }
58
+ function tryMove(state, move) {
59
+ const { from, to, count } = move;
60
+ if (count !== 1) return null;
61
+ if (from.zone !== "tableau") return null;
62
+ if (!state.piles[from.index] || state.piles[from.index].length === 0) return null;
63
+ if (to.zone === "discard") {
64
+ if (!canDiscard(state.piles, from.index)) return null;
65
+ const next = cloneState(state);
66
+ const nextSourcePile = state.piles[from.index].slice();
67
+ const nextDiscard = state.discard.slice();
68
+ const card = nextSourcePile.pop();
69
+ nextDiscard.push(card);
70
+ setPile(next, from, nextSourcePile);
71
+ setPile(next, to, nextDiscard);
72
+ return next;
73
+ }
74
+ if (to.zone === "tableau") {
75
+ if (!canMoveToEmpty(state.piles, from.index, to.index)) return null;
76
+ const next = cloneState(state);
77
+ const nextSourcePile = state.piles[from.index].slice();
78
+ const nextDestPile = state.piles[to.index].slice();
79
+ const card = nextSourcePile.pop();
80
+ nextDestPile.push(card);
81
+ setPile(next, from, nextSourcePile);
82
+ setPile(next, to, nextDestPile);
83
+ return next;
84
+ }
85
+ return null;
86
+ }
87
+ function drawStock(state) {
88
+ if (state.stock.length === 0) return null;
89
+ const next = cloneState(state);
90
+ const nextStock = state.stock.slice();
91
+ for (let i = 0; i < NUM_PILES; i++) {
92
+ const card = nextStock.shift();
93
+ if (!card) break;
94
+ const nextPile = state.piles[i].slice();
95
+ nextPile.push(card.faceUp ? card : { ...card, faceUp: true });
96
+ setPile(next, { zone: "tableau", index: i }, nextPile);
97
+ }
98
+ setPile(next, { zone: "stock", index: 0 }, nextStock);
99
+ return next;
100
+ }
101
+ function isWon(state) {
102
+ if (state.stock.length > 0) return false;
103
+ return state.piles.every((p) => p.length === 1 && p[0].rank === 1);
104
+ }
105
+ function canonicalMoveFor(piles, pileIndex) {
106
+ if (piles[pileIndex].length === 0) return null;
107
+ if (canDiscard(piles, pileIndex)) {
108
+ return { from: { zone: "tableau", index: pileIndex }, to: { zone: "discard", index: 0 }, count: 1 };
109
+ }
110
+ for (let j = 0; j < NUM_PILES; j++) {
111
+ if (canMoveToEmpty(piles, pileIndex, j)) {
112
+ return { from: { zone: "tableau", index: pileIndex }, to: { zone: "tableau", index: j }, count: 1 };
113
+ }
114
+ }
115
+ return null;
116
+ }
117
+ function legalMoves(state) {
118
+ const canonical = [];
119
+ for (let i = 0; i < NUM_PILES; i++) canonical.push(canonicalMoveFor(state.piles, i));
120
+ const discards = canonical.filter((m) => !!m && m.to.zone === "discard");
121
+ const moves = canonical.filter((m) => !!m && m.to.zone === "tableau");
122
+ return [...discards, ...moves];
123
+ }
124
+ function scoreHintMove(state, move) {
125
+ if (move.from.zone !== "tableau") return 0;
126
+ if (move.to.zone === "discard") return 100;
127
+ if (move.to.zone !== "tableau") return 0;
128
+ const fromPile = state.piles[move.from.index];
129
+ return fromPile && fromPile.length > 1 ? 50 : 0;
130
+ }
131
+ function isStuck(state) {
132
+ return state.stock.length === 0 && !isWon(state) && legalMoves(state).length === 0;
133
+ }
134
+ function autoMoveHint(state, from, cardId) {
135
+ if (from.zone !== "tableau") return null;
136
+ const card = top(state.piles[from.index]);
137
+ if (!card || card.id !== cardId) return null;
138
+ return canonicalMoveFor(state.piles, from.index);
139
+ }
140
+ var progress = {
141
+ id: "acesup",
142
+ moves: (state) => allDestinations({ legalMoves, tryMove }, state, { tableau: NUM_PILES }),
143
+ drawIsStep: false,
144
+ key: (state) => `${columnsKey(state.piles)}/${state.stock.length}`,
145
+ progress: (state) => [state.discard.length]
146
+ };
147
+ var AcesUpController = {
148
+ id: "acesup",
149
+ title: "Aces Up",
150
+ newGame,
151
+ legalMoves,
152
+ tryMove,
153
+ drawStock,
154
+ isWon,
155
+ isStuck,
156
+ autoMoveHint,
157
+ scoreHintMove,
158
+ progress
159
+ };
160
+
161
+ export {
162
+ AcesUpController
163
+ };
@@ -0,0 +1,163 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkXV5OUPIWjs = require('./chunk-XV5OUPIW.js');
5
+
6
+
7
+
8
+ var _chunkW5CPH6TDjs = require('./chunk-W5CPH6TD.js');
9
+
10
+ // src/games/acesup/rules.ts
11
+ var NUM_PILES = 4;
12
+ function effectiveRank(card) {
13
+ return card.rank === 1 ? 14 : card.rank;
14
+ }
15
+ function cloneState(state) {
16
+ return {
17
+ piles: state.piles.slice(),
18
+ stock: state.stock,
19
+ discard: state.discard
20
+ };
21
+ }
22
+ function setPile(state, ref, pile) {
23
+ switch (ref.zone) {
24
+ case "tableau":
25
+ state.piles[ref.index] = pile;
26
+ break;
27
+ case "stock":
28
+ state.stock = pile;
29
+ break;
30
+ case "discard":
31
+ state.discard = pile;
32
+ break;
33
+ }
34
+ }
35
+ function canDiscard(piles, pileIndex) {
36
+ const card = _chunkW5CPH6TDjs.top.call(void 0, piles[pileIndex]);
37
+ if (!card) return false;
38
+ return piles.some((p, i) => {
39
+ if (i === pileIndex) return false;
40
+ const other = _chunkW5CPH6TDjs.top.call(void 0, p);
41
+ return !!other && other.suit === card.suit && effectiveRank(other) > effectiveRank(card);
42
+ });
43
+ }
44
+ function canMoveToEmpty(piles, fromIndex, toIndex) {
45
+ if (fromIndex === toIndex) return false;
46
+ if (piles[fromIndex].length === 0) return false;
47
+ return piles[toIndex].length === 0;
48
+ }
49
+ function newGame(seed) {
50
+ const deck = _chunkW5CPH6TDjs.shuffledDeck.call(void 0, seed, 1);
51
+ const piles = Array.from({ length: NUM_PILES }, () => []);
52
+ for (let i = 0; i < NUM_PILES; i++) {
53
+ piles[i].push({ ...deck[i], faceUp: true });
54
+ }
55
+ const stock = deck.slice(NUM_PILES).map((c) => ({ ...c, faceUp: false }));
56
+ return { piles, stock, discard: [] };
57
+ }
58
+ function tryMove(state, move) {
59
+ const { from, to, count } = move;
60
+ if (count !== 1) return null;
61
+ if (from.zone !== "tableau") return null;
62
+ if (!state.piles[from.index] || state.piles[from.index].length === 0) return null;
63
+ if (to.zone === "discard") {
64
+ if (!canDiscard(state.piles, from.index)) return null;
65
+ const next = cloneState(state);
66
+ const nextSourcePile = state.piles[from.index].slice();
67
+ const nextDiscard = state.discard.slice();
68
+ const card = nextSourcePile.pop();
69
+ nextDiscard.push(card);
70
+ setPile(next, from, nextSourcePile);
71
+ setPile(next, to, nextDiscard);
72
+ return next;
73
+ }
74
+ if (to.zone === "tableau") {
75
+ if (!canMoveToEmpty(state.piles, from.index, to.index)) return null;
76
+ const next = cloneState(state);
77
+ const nextSourcePile = state.piles[from.index].slice();
78
+ const nextDestPile = state.piles[to.index].slice();
79
+ const card = nextSourcePile.pop();
80
+ nextDestPile.push(card);
81
+ setPile(next, from, nextSourcePile);
82
+ setPile(next, to, nextDestPile);
83
+ return next;
84
+ }
85
+ return null;
86
+ }
87
+ function drawStock(state) {
88
+ if (state.stock.length === 0) return null;
89
+ const next = cloneState(state);
90
+ const nextStock = state.stock.slice();
91
+ for (let i = 0; i < NUM_PILES; i++) {
92
+ const card = nextStock.shift();
93
+ if (!card) break;
94
+ const nextPile = state.piles[i].slice();
95
+ nextPile.push(card.faceUp ? card : { ...card, faceUp: true });
96
+ setPile(next, { zone: "tableau", index: i }, nextPile);
97
+ }
98
+ setPile(next, { zone: "stock", index: 0 }, nextStock);
99
+ return next;
100
+ }
101
+ function isWon(state) {
102
+ if (state.stock.length > 0) return false;
103
+ return state.piles.every((p) => p.length === 1 && p[0].rank === 1);
104
+ }
105
+ function canonicalMoveFor(piles, pileIndex) {
106
+ if (piles[pileIndex].length === 0) return null;
107
+ if (canDiscard(piles, pileIndex)) {
108
+ return { from: { zone: "tableau", index: pileIndex }, to: { zone: "discard", index: 0 }, count: 1 };
109
+ }
110
+ for (let j = 0; j < NUM_PILES; j++) {
111
+ if (canMoveToEmpty(piles, pileIndex, j)) {
112
+ return { from: { zone: "tableau", index: pileIndex }, to: { zone: "tableau", index: j }, count: 1 };
113
+ }
114
+ }
115
+ return null;
116
+ }
117
+ function legalMoves(state) {
118
+ const canonical = [];
119
+ for (let i = 0; i < NUM_PILES; i++) canonical.push(canonicalMoveFor(state.piles, i));
120
+ const discards = canonical.filter((m) => !!m && m.to.zone === "discard");
121
+ const moves = canonical.filter((m) => !!m && m.to.zone === "tableau");
122
+ return [...discards, ...moves];
123
+ }
124
+ function scoreHintMove(state, move) {
125
+ if (move.from.zone !== "tableau") return 0;
126
+ if (move.to.zone === "discard") return 100;
127
+ if (move.to.zone !== "tableau") return 0;
128
+ const fromPile = state.piles[move.from.index];
129
+ return fromPile && fromPile.length > 1 ? 50 : 0;
130
+ }
131
+ function isStuck(state) {
132
+ return state.stock.length === 0 && !isWon(state) && legalMoves(state).length === 0;
133
+ }
134
+ function autoMoveHint(state, from, cardId) {
135
+ if (from.zone !== "tableau") return null;
136
+ const card = _chunkW5CPH6TDjs.top.call(void 0, state.piles[from.index]);
137
+ if (!card || card.id !== cardId) return null;
138
+ return canonicalMoveFor(state.piles, from.index);
139
+ }
140
+ var progress = {
141
+ id: "acesup",
142
+ moves: (state) => _chunkXV5OUPIWjs.allDestinations.call(void 0, { legalMoves, tryMove }, state, { tableau: NUM_PILES }),
143
+ drawIsStep: false,
144
+ key: (state) => `${_chunkXV5OUPIWjs.columnsKey.call(void 0, state.piles)}/${state.stock.length}`,
145
+ progress: (state) => [state.discard.length]
146
+ };
147
+ var AcesUpController = {
148
+ id: "acesup",
149
+ title: "Aces Up",
150
+ newGame,
151
+ legalMoves,
152
+ tryMove,
153
+ drawStock,
154
+ isWon,
155
+ isStuck,
156
+ autoMoveHint,
157
+ scoreHintMove,
158
+ progress
159
+ };
160
+
161
+
162
+
163
+ exports.AcesUpController = AcesUpController;