@sudobility/sudojo_lib 0.0.192 → 0.0.194
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.
package/README.md
CHANGED
|
@@ -8,30 +8,47 @@ Business logic library for Sudojo with React hooks for game state, hints, and Su
|
|
|
8
8
|
bun add @sudobility/sudojo_lib
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Published with restricted access: installing requires npm credentials for the `@sudobility` scope.
|
|
12
|
+
|
|
11
13
|
## Usage
|
|
12
14
|
|
|
13
15
|
```typescript
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
import { useSudoku, useHint, presentBoard } from '@sudobility/sudojo_lib';
|
|
17
|
+
|
|
18
|
+
function Game({ puzzle, solution, networkClient, baseUrl, token }) {
|
|
19
|
+
const sudoku = useSudoku();
|
|
20
|
+
useEffect(() => sudoku.loadBoard(puzzle, solution), [puzzle, solution]);
|
|
21
|
+
|
|
22
|
+
const { hint, getHint, applyHint, isLoading } = useHint({
|
|
23
|
+
networkClient,
|
|
24
|
+
baseUrl,
|
|
25
|
+
token,
|
|
26
|
+
puzzle: sudoku.getScrambledPuzzle(), // boards are scrambled by default
|
|
27
|
+
userInput: sudoku.getInputString(),
|
|
28
|
+
pencilmarks: sudoku.getPencilmarksString(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const cells = presentBoard({
|
|
32
|
+
cells: sudoku.board?.cells ?? [],
|
|
33
|
+
selectedIndex: sudoku.selectedIndex,
|
|
34
|
+
showErrors: true,
|
|
35
|
+
});
|
|
20
36
|
}
|
|
21
37
|
```
|
|
22
38
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const isValid = validateBoard(board);
|
|
27
|
-
const candidates = getCandidates(board, row, col);
|
|
28
|
-
```
|
|
39
|
+
Server-data hooks (`useLevels`, `useDailyGame`, `useLevelGame`, `useBoardEntry`, `useGameSession`, ...)
|
|
40
|
+
need a TanStack `QueryClientProvider`; `useLevelEnabled` / `useTechniqueEnabled` read from `EntitlementProvider`.
|
|
29
41
|
|
|
30
42
|
## API
|
|
31
43
|
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
-
|
|
44
|
+
- **Game state**: `useSudoku` (flat 81-cell board; replaces deprecated `useGame`), `useBoardEntry`
|
|
45
|
+
- **Hints**: `useHint`, `useAutoHint`, hint text and technique walkthrough builders
|
|
46
|
+
- **Persistence**: `useGamePlay` / `useGamePlayStore` (Zustand, daily + play slots), `useGameTimer`
|
|
47
|
+
- **Server data**: `useLevels`, `useTechniques`, `useLearning`, `useCommunities`, `useDailyGame`, `useLevelGame`, `useGameSession`
|
|
48
|
+
- **Utilities**: `presentBoard`, scrambler and puzzle-string helpers, progress, time, theme, i18n keys, share URLs
|
|
49
|
+
|
|
50
|
+
Full reference: [docs/API.md](docs/API.md). Shared by `sudojo_app` (web), `sudojo_app_rn` (mobile),
|
|
51
|
+
`sudojo_ui`, and `sudojo_extension`.
|
|
35
52
|
|
|
36
53
|
## Development
|
|
37
54
|
|
|
@@ -47,8 +64,9 @@ bun run check-all # Lint + typecheck + tests
|
|
|
47
64
|
## Related Packages
|
|
48
65
|
|
|
49
66
|
- `@sudobility/sudojo_client` -- API client hooks (peer dependency)
|
|
50
|
-
- `@sudobility/sudojo_types` -- Type definitions
|
|
51
|
-
-
|
|
67
|
+
- `@sudobility/sudojo_types` -- Type definitions (peer dependency)
|
|
68
|
+
- `@sudobility/types`, `@sudobility/di`, `@tanstack/react-query`, `react`, `zustand` -- other peer dependencies
|
|
69
|
+
- `sudojo_app` / `sudojo_app_rn` / `sudojo_ui` / `sudojo_extension` -- Consumers
|
|
52
70
|
|
|
53
71
|
## License
|
|
54
72
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hintExplanation.d.ts","sourceRoot":"","sources":["../../src/utils/hintExplanation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"hintExplanation.d.ts","sourceRoot":"","sources":["../../src/utils/hintExplanation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAiJzD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,cAAc,EACpB,WAAW,CAAC,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,YAAY,GAC1B,MAAM,CAgFR;AAqzBD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,cAAc,EACpB,YAAY,CAAC,EAAE,YAAY,EAC3B,CAAC,CAAC,EAAE,iBAAiB,GACpB,MAAM,CAuDR"}
|
|
@@ -85,7 +85,8 @@ function findCommonHouse(cells) {
|
|
|
85
85
|
// Extract cells that have select action (digit placement)
|
|
86
86
|
// Note: select: "0" means no selection (placeholder), only 1-9 are valid digits
|
|
87
87
|
function getSelectCells(hint) {
|
|
88
|
-
|
|
88
|
+
// cells is null on the solver's auto-pencilmark hint (technique 0)
|
|
89
|
+
return (hint.cells ?? [])
|
|
89
90
|
.filter((c) => c.actions.select && c.actions.select !== '' && c.actions.select !== '0')
|
|
90
91
|
.map((c) => ({
|
|
91
92
|
row: c.row,
|
|
@@ -96,7 +97,8 @@ function getSelectCells(hint) {
|
|
|
96
97
|
// Extract cells that have remove action (eliminations)
|
|
97
98
|
// Note: Filter out cells where remove only contains "0" (placeholder)
|
|
98
99
|
function getRemoveCells(hint) {
|
|
99
|
-
|
|
100
|
+
// cells is null on the solver's auto-pencilmark hint (technique 0)
|
|
101
|
+
return (hint.cells ?? [])
|
|
100
102
|
.filter((c) => c.actions.remove &&
|
|
101
103
|
c.actions.remove !== '' &&
|
|
102
104
|
getValidDigits(c.actions.remove).length > 0)
|
|
@@ -109,7 +111,8 @@ function getRemoveCells(hint) {
|
|
|
109
111
|
// Extract cells that have highlight action (pattern cells)
|
|
110
112
|
// Note: Filter out cells where highlight only contains "0" (placeholder)
|
|
111
113
|
function getHighlightCells(hint) {
|
|
112
|
-
|
|
114
|
+
// cells is null on the solver's auto-pencilmark hint (technique 0)
|
|
115
|
+
return (hint.cells ?? [])
|
|
113
116
|
.filter((c) => c.actions.highlight &&
|
|
114
117
|
c.actions.highlight !== '' &&
|
|
115
118
|
getValidDigits(c.actions.highlight).length > 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hintExplanation.js","sourceRoot":"","sources":["../../src/utils/hintExplanation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,oFAAoF;AACpF,IAAI,QAAQ,GAAiB,SAAS,CAAC;AAEvC,8BAA8B;AAC9B,SAAS,QAAQ,CAAC,GAAW,EAAE,GAAW;IACxC,OAAO,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;AAClC,CAAC;AAED,yBAAyB;AACzB,SAAS,QAAQ,CAAC,KAA0C;IAC1D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,iDAAiD;AACjD,yD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AAC,CAAC,2BAA2B,EAAE;YAC7B,YAAY,EAAE,qBAAqB;SACpC,CAAC;QACJ,CAAC,CAAC,qBAAqB,CAAC;AAC5B,CAAC","sourcesContent":["/**\n * Generate detailed hint explanations based on the hint payload\n * Similar to tutorial explanations but for live hints\n *\n * Each explanation is designed to teach the user WHY the technique works,\n * not just WHAT to do.\n */\n\nimport type { SolverHintCell, SolverHintStep } from '@sudobility/sudojo_types';\nimport { TechniqueId } from '@sudobility/sudojo_types';\nimport type { DigitDisplay } from '../types/settings';\nimport { displayDigit as mapDigitDisplay } from './digitDisplay';\nimport type { TranslateFunction } from './localizedHint';\n\n// Module-level display format, set by public entry points before calling internals.\nlet _display: DigitDisplay = 'numeric';\n\n// Cell notation (R1C1 format)\nfunction cellName(row: number, col: number): string {\n return `R${row + 1}C${col + 1}`;\n}\n\n// Format a list of cells\nfunction cellList(cells: Array<{ row: number; col: number }>): string {\n return cells.map(c => cellName(c.row, c.col)).join(', ');\n}\n\n// Format digit(s) - only valid Sudoku digits 1-9\n// Uses module-level _display set by public entry points.\nfunction formatDigit(d: string | number): string {\n const s = String(d);\n if (s < '1' || s > '9') return '?';\n if (_display !== 'numeric') {\n return mapDigitDisplay(parseInt(s, 10), _display);\n }\n return s;\n}\n\n// Format multiple digits as set - only valid Sudoku digits 1-9\nfunction formatDigits(digits: string | string[]): string {\n const arr = Array.isArray(digits)\n ? digits.filter(d => d >= '1' && d <= '9')\n : digits.split('').filter(d => d >= '1' && d <= '9');\n if (arr.length === 0) return '';\n if (arr.length === 1) return formatDigit(arr[0] ?? '');\n return `{${arr\n .sort()\n .map(d => formatDigit(d))\n .join(', ')}}`;\n}\n\n// Extract first valid Sudoku digit (1-9) from a string\nfunction getFirstValidDigit(digits: string | undefined): string {\n if (!digits) return '?';\n for (const d of digits) {\n if (d >= '1' && d <= '9') return d;\n }\n return '?';\n}\n\n// Extract all valid Sudoku digits (1-9) from a string\nfunction getValidDigits(digits: string | undefined): string[] {\n if (!digits) return [];\n return digits.split('').filter(d => d >= '1' && d <= '9');\n}\n\n// Get block number (1-9) from row/col\nfunction getBlock(row: number, col: number): number {\n return Math.floor(row / 3) * 3 + Math.floor(col / 3) + 1;\n}\n\n// Determine the common house for cells\nfunction findCommonHouse(\n cells: Array<{ row: number; col: number }>\n): { type: 'row' | 'col' | 'block'; index: number; name: string } | null {\n const first = cells[0];\n if (cells.length < 2 || !first) return null;\n\n const sameRow = cells.every(c => c.row === first.row);\n if (sameRow) {\n return { type: 'row', index: first.row, name: `Row ${first.row + 1}` };\n }\n\n const sameCol = cells.every(c => c.col === first.col);\n if (sameCol) {\n return { type: 'col', index: first.col, name: `Column ${first.col + 1}` };\n }\n\n const sameBlock = cells.every(\n c => getBlock(c.row, c.col) === getBlock(first.row, first.col)\n );\n if (sameBlock) {\n const block = getBlock(first.row, first.col);\n return { type: 'block', index: block, name: `Block ${block}` };\n }\n\n return null;\n}\n\n// Extract cells that have select action (digit placement)\n// Note: select: \"0\" means no selection (placeholder), only 1-9 are valid digits\nfunction getSelectCells(\n hint: SolverHintStep\n): Array<{ row: number; col: number; digit: string }> {\n return hint.cells\n .filter(\n (c: SolverHintCell) =>\n c.actions.select && c.actions.select !== '' && c.actions.select !== '0'\n )\n .map((c: SolverHintCell) => ({\n row: c.row,\n col: c.column,\n digit: c.actions.select,\n }));\n}\n\n// Extract cells that have remove action (eliminations)\n// Note: Filter out cells where remove only contains \"0\" (placeholder)\nfunction getRemoveCells(\n hint: SolverHintStep\n): Array<{ row: number; col: number; digits: string }> {\n return hint.cells\n .filter(\n (c: SolverHintCell) =>\n c.actions.remove &&\n c.actions.remove !== '' &&\n getValidDigits(c.actions.remove).length > 0\n )\n .map((c: SolverHintCell) => ({\n row: c.row,\n col: c.column,\n digits: c.actions.remove,\n }));\n}\n\n// Extract cells that have highlight action (pattern cells)\n// Note: Filter out cells where highlight only contains \"0\" (placeholder)\nfunction getHighlightCells(\n hint: SolverHintStep\n): Array<{ row: number; col: number; digits: string }> {\n return hint.cells\n .filter(\n (c: SolverHintCell) =>\n c.actions.highlight &&\n c.actions.highlight !== '' &&\n getValidDigits(c.actions.highlight).length > 0\n )\n .map((c: SolverHintCell) => ({\n row: c.row,\n col: c.column,\n digits: c.actions.highlight,\n }));\n}\n\n/**\n * Generate detailed explanation for a hint\n *\n * @param hint - The hint step data\n * @param techniqueId - The technique ID (from SolverHints.technique)\n * @param digitDisplay - Optional digit display format\n */\nexport function generateDetailedExplanation(\n hint: SolverHintStep,\n techniqueId?: number,\n digitDisplay?: DigitDisplay\n): string {\n _display = digitDisplay ?? 'numeric';\n const selectCells = getSelectCells(hint);\n const removeCells = getRemoveCells(hint);\n const highlightCells = getHighlightCells(hint);\n\n switch (techniqueId) {\n case TechniqueId.FULL_HOUSE:\n return explainFullHouse(hint, selectCells);\n\n case TechniqueId.HIDDEN_SINGLE:\n return explainHiddenSingle(hint, selectCells);\n\n case TechniqueId.NAKED_SINGLE:\n return explainNakedSingle(hint, selectCells);\n\n case TechniqueId.HIDDEN_PAIR:\n return explainHiddenPair(hint, highlightCells, removeCells);\n\n case TechniqueId.NAKED_PAIR:\n return explainNakedPair(hint, highlightCells, removeCells);\n\n case TechniqueId.LOCKED_CANDIDATES:\n return explainLockedCandidates(hint, highlightCells, removeCells);\n\n case TechniqueId.HIDDEN_TRIPLE:\n return explainHiddenTriple(hint, highlightCells, removeCells);\n\n case TechniqueId.NAKED_TRIPLE:\n return explainNakedTriple(hint, highlightCells, removeCells);\n\n case TechniqueId.HIDDEN_QUAD:\n return explainHiddenQuad(hint, highlightCells, removeCells);\n\n case TechniqueId.NAKED_QUAD:\n return explainNakedQuad(hint, highlightCells, removeCells);\n\n case TechniqueId.X_WING:\n return explainXWing(hint, highlightCells, removeCells);\n\n case TechniqueId.SWORDFISH:\n return explainSwordfish(hint, highlightCells, removeCells);\n\n case TechniqueId.JELLYFISH:\n return explainJellyfish(hint, highlightCells, removeCells);\n\n case TechniqueId.XY_WING:\n return explainXYWing(hint, highlightCells, removeCells);\n\n case TechniqueId.FINNED_X_WING:\n return explainFinnedXWing(hint, highlightCells, removeCells);\n\n case TechniqueId.SQUIRMBAG:\n return explainSquirmbag(hint, highlightCells, removeCells);\n\n case TechniqueId.FINNED_SWORDFISH:\n return explainFinnedSwordfish(hint, highlightCells, removeCells);\n\n case TechniqueId.FINNED_JELLYFISH:\n return explainFinnedJellyfish(hint, highlightCells, removeCells);\n\n case TechniqueId.XYZ_WING:\n return explainXYZWing(hint, highlightCells, removeCells);\n\n case TechniqueId.WXYZ_WING:\n return explainWXYZWing(hint, highlightCells, removeCells);\n\n case TechniqueId.ALMOST_LOCKED_SETS:\n return explainAlmostLockedSets(hint, highlightCells, removeCells);\n\n case TechniqueId.FINNED_SQUIRMBAG:\n return explainFinnedSquirmbag(hint, highlightCells, removeCells);\n\n case TechniqueId.ALS_CHAIN:\n case TechniqueId.ALS_XZ:\n return explainALSChain(hint, highlightCells, removeCells);\n\n default:\n return generateGenericExplanation(hint, selectCells, removeCells);\n }\n}\n\n/**\n * Full House: The last empty cell in a house.\n */\nfunction explainFullHouse(\n hint: SolverHintStep,\n selectCells: Array<{ row: number; col: number; digit: string }>\n): string {\n if (selectCells.length !== 1) return hint.text;\n\n const cell = selectCells[0];\n if (!cell) return hint.text;\n const digit = formatDigit(cell.digit);\n\n const area = hint.areas?.[0];\n let houseName = '';\n if (area) {\n if (area.type === 'row') houseName = `Row ${area.index + 1}`;\n else if (area.type === 'column') houseName = `Column ${area.index + 1}`;\n else if (area.type === 'block') houseName = `Block ${area.index + 1}`;\n }\n\n if (houseName) {\n return (\n `${houseName} has 8 cells filled, leaving only ${cellName(cell.row, cell.col)} empty. ` +\n `The missing digit is ${digit} — place it here.`\n );\n }\n\n return (\n `Cell ${cellName(cell.row, cell.col)} is the only empty cell in its house. ` +\n `Place ${digit} here.`\n );\n}\n\n/**\n * Hidden Single: A digit that can only go in one cell within a house.\n */\nfunction explainHiddenSingle(\n hint: SolverHintStep,\n selectCells: Array<{ row: number; col: number; digit: string }>\n): string {\n if (selectCells.length !== 1) return hint.text;\n\n const cell = selectCells[0];\n if (!cell) return hint.text;\n const digit = formatDigit(cell.digit);\n\n const area = hint.areas?.[0];\n let houseName: string;\n if (area) {\n houseName =\n area.type === 'row'\n ? `Row ${area.index + 1}`\n : area.type === 'column'\n ? `Column ${area.index + 1}`\n : `Block ${area.index + 1}`;\n } else {\n houseName = `Block ${getBlock(cell.row, cell.col)}`;\n }\n\n return (\n `In ${houseName}, digit ${digit} can only go in one cell: ${cellName(cell.row, cell.col)}. ` +\n `Even though this cell may have other candidates, ${digit} has no other place in ${houseName.toLowerCase()}. ` +\n `Place ${digit} here.`\n );\n}\n\n/**\n * Naked Single: A cell with only one candidate remaining.\n */\nfunction explainNakedSingle(\n hint: SolverHintStep,\n selectCells: Array<{ row: number; col: number; digit: string }>\n): string {\n if (selectCells.length !== 1) return hint.text;\n\n const cell = selectCells[0];\n if (!cell) return hint.text;\n const digit = formatDigit(cell.digit);\n\n return (\n `Cell ${cellName(cell.row, cell.col)} has only one candidate left: ${digit}. ` +\n `All other digits are eliminated by numbers already placed in its row, column, and block. ` +\n `Place ${digit} here.`\n );\n}\n\n/**\n * Hidden Pair: Two digits that can only appear in exactly two cells within a house.\n */\nfunction explainHiddenPair(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 2) return hint.text;\n\n const cells = highlightCells\n .slice(0, 2)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const hiddenDigits = new Set<string>();\n highlightCells.slice(0, 2).forEach(c => {\n for (const d of getValidDigits(c.digits)) hiddenDigits.add(d);\n });\n const pairDigits = formatDigits(Array.from(hiddenDigits));\n\n const eliminations = removeCells.filter(c =>\n cells.some(hc => hc.row === c.row && hc.col === c.col)\n );\n\n let explanation = `In ${houseName}, digits ${pairDigits} can ONLY appear in ${cellList(cells)}. `;\n explanation += `These form a Hidden Pair — the pair is \"hidden\" among other candidates. `;\n explanation += `Since ${pairDigits} must occupy these 2 cells, `;\n\n if (eliminations.length > 0) {\n const elimDigits = new Set<string>();\n eliminations.forEach(e => {\n for (const d of getValidDigits(e.digits)) elimDigits.add(d);\n });\n explanation += `eliminate the other candidates ${formatDigits(Array.from(elimDigits))} from these cells.`;\n } else {\n explanation += `other candidates can be eliminated.`;\n }\n\n return explanation;\n}\n\n/**\n * Naked Pair: Two cells in a house that contain exactly the same two candidates.\n */\nfunction explainNakedPair(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 2) return hint.text;\n\n const cells = highlightCells\n .slice(0, 2)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their shared house';\n\n const pairDigits = formatDigits(getValidDigits(highlightCells[0]?.digits));\n\n let explanation = `Cells ${cellList(cells)} both contain exactly ${pairDigits} as their only candidates. `;\n explanation += `This is a Naked Pair — the pair is \"naked\" because these cells show only these digits. `;\n explanation += `Since ${pairDigits} must go in these cells, `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells\n .filter(c => !cells.some(pc => pc.row === c.row && pc.col === c.col))\n .map(c => ({ row: c.row, col: c.col }));\n if (elimCells.length > 0) {\n explanation += `eliminate ${pairDigits} from other cells in ${houseName.toLowerCase()}: ${cellList(elimCells)}.`;\n } else {\n explanation += `they can be eliminated from other cells in the house.`;\n }\n }\n\n return explanation;\n}\n\n/**\n * Locked Candidates (Pointing/Claiming)\n */\nfunction explainLockedCandidates(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 2) return hint.text;\n\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const first = cells[0];\n if (!first) return hint.text;\n const lockedDigit = formatDigit(\n getFirstValidDigit(highlightCells[0]?.digits)\n );\n\n const sameRow = cells.every(c => c.row === first.row);\n const sameCol = cells.every(c => c.col === first.col);\n const sameBlock = cells.every(\n c => getBlock(c.row, c.col) === getBlock(first.row, first.col)\n );\n\n const block = getBlock(first.row, first.col);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n const elimInSameBlock = elimCells.every(\n c => getBlock(c.row, c.col) === block\n );\n\n let explanation = '';\n\n if (sameBlock && (sameRow || sameCol)) {\n if (elimInSameBlock) {\n const lineName = sameRow\n ? `Row ${first.row + 1}`\n : `Column ${first.col + 1}`;\n explanation = `In ${lineName}, digit ${lockedDigit} can only appear in Block ${block} (cells ${cellList(cells)}). `;\n explanation += `This \"claims\" ${lockedDigit} for this line within the block. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from other cells in Block ${block}: ${cellList(elimCells)}.`;\n }\n } else {\n const lineName = sameRow\n ? `Row ${first.row + 1}`\n : `Column ${first.col + 1}`;\n explanation = `In Block ${block}, digit ${lockedDigit} can only appear in ${lineName} (cells ${cellList(cells)}). `;\n explanation += `This \"points\" to ${lockedDigit} being restricted to this line. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from ${cellList(elimCells)} in ${lineName} outside Block ${block}.`;\n }\n }\n } else if (sameRow) {\n explanation = `Digit ${lockedDigit} is locked to Row ${first.row + 1} in these cells: ${cellList(cells)}. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from ${cellList(elimCells)}.`;\n }\n } else if (sameCol) {\n explanation = `Digit ${lockedDigit} is locked to Column ${first.col + 1} in these cells: ${cellList(cells)}. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from ${cellList(elimCells)}.`;\n }\n } else {\n explanation = `Locked Candidates pattern for digit ${lockedDigit}. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from ${cellList(elimCells)}.`;\n }\n }\n\n return explanation;\n}\n\n/**\n * Hidden Triple: Three digits that can only appear in exactly three cells within a house.\n */\nfunction explainHiddenTriple(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 3) return hint.text;\n\n const cells = highlightCells\n .slice(0, 3)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const hiddenDigits = new Set<string>();\n highlightCells.slice(0, 3).forEach(c => {\n for (const d of getValidDigits(c.digits)) hiddenDigits.add(d);\n });\n const tripleDigits = formatDigits(Array.from(hiddenDigits));\n\n let explanation = `In ${houseName}, digits ${tripleDigits} can ONLY appear in cells ${cellList(cells)}. `;\n explanation += `This is a Hidden Triple — these 3 digits are \"hidden\" among other candidates. `;\n explanation += `Since ${tripleDigits} must occupy these 3 cells, `;\n\n if (removeCells.length > 0) {\n const elimDigits = new Set<string>();\n removeCells\n .filter(c => cells.some(hc => hc.row === c.row && hc.col === c.col))\n .forEach(e => {\n for (const d of getValidDigits(e.digits)) elimDigits.add(d);\n });\n if (elimDigits.size > 0) {\n explanation += `eliminate the other candidates ${formatDigits(Array.from(elimDigits))} from these cells.`;\n } else {\n explanation += `other candidates can be eliminated.`;\n }\n } else {\n explanation += `other candidates can be eliminated.`;\n }\n\n return explanation;\n}\n\n/**\n * Naked Triple: Three cells in a house that together contain only three candidates total.\n */\nfunction explainNakedTriple(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 3) return hint.text;\n\n const cells = highlightCells\n .slice(0, 3)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const nakedDigits = new Set<string>();\n highlightCells.slice(0, 3).forEach(c => {\n for (const d of getValidDigits(c.digits)) nakedDigits.add(d);\n });\n const tripleDigits = formatDigits(Array.from(nakedDigits));\n\n let explanation = `Cells ${cellList(cells)} together contain only the candidates ${tripleDigits}. `;\n explanation += `This is a Naked Triple — these 3 cells share only 3 digits between them. `;\n explanation += `Since ${tripleDigits} must go in these cells, `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.filter(\n c => !cells.some(nc => nc.row === c.row && nc.col === c.col)\n );\n if (elimCells.length > 0) {\n explanation += `eliminate ${tripleDigits} from other cells in ${houseName.toLowerCase()}: ${cellList(elimCells.map(c => ({ row: c.row, col: c.col })))}.`;\n } else {\n explanation += `they can be eliminated from other cells.`;\n }\n } else {\n explanation += `they can be eliminated from other cells.`;\n }\n\n return explanation;\n}\n\n/**\n * Hidden Quad: Four digits that can only appear in exactly four cells within a house.\n */\nfunction explainHiddenQuad(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const cells = highlightCells\n .slice(0, 4)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const hiddenDigits = new Set<string>();\n highlightCells.slice(0, 4).forEach(c => {\n for (const d of getValidDigits(c.digits)) hiddenDigits.add(d);\n });\n const quadDigits = formatDigits(Array.from(hiddenDigits));\n\n let explanation = `In ${houseName}, digits ${quadDigits} can ONLY appear in cells ${cellList(cells)}. `;\n explanation += `This is a Hidden Quad — 4 digits restricted to 4 cells. `;\n\n if (removeCells.length > 0) {\n const elimDigits = new Set<string>();\n removeCells\n .filter(c => cells.some(hc => hc.row === c.row && hc.col === c.col))\n .forEach(e => {\n for (const d of getValidDigits(e.digits)) elimDigits.add(d);\n });\n if (elimDigits.size > 0) {\n explanation += `Eliminate the other candidates ${formatDigits(Array.from(elimDigits))} from these cells.`;\n }\n }\n\n return explanation;\n}\n\n/**\n * Naked Quad: Four cells in a house that together contain only four candidates total.\n */\nfunction explainNakedQuad(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const cells = highlightCells\n .slice(0, 4)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const nakedDigits = new Set<string>();\n highlightCells.slice(0, 4).forEach(c => {\n for (const d of getValidDigits(c.digits)) nakedDigits.add(d);\n });\n const quadDigits = formatDigits(Array.from(nakedDigits));\n\n let explanation = `Cells ${cellList(cells)} together contain only the candidates ${quadDigits}. `;\n explanation += `This is a Naked Quad — 4 cells sharing only 4 digits. `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.filter(\n c => !cells.some(nc => nc.row === c.row && nc.col === c.col)\n );\n if (elimCells.length > 0) {\n explanation += `Eliminate ${quadDigits} from other cells in ${houseName.toLowerCase()}: ${cellList(elimCells.map(c => ({ row: c.row, col: c.col })))}.`;\n }\n }\n\n return explanation;\n}\n\n/**\n * X-Wing: A 2x2 fish pattern.\n */\nfunction explainXWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n const elimInCols =\n elimCells.length > 0 && elimCells.every(c => cols.includes(c.col));\n\n let explanation = '';\n if (elimInCols || rows.length === 2) {\n explanation = `X-Wing found for digit ${digit}. `;\n explanation += `In Rows ${rows.map(r => r + 1).join(' and ')}, digit ${digit} appears only in Columns ${cols.map(c => c + 1).join(' and ')}. `;\n explanation += `This forms a rectangle where ${digit} must occupy two opposite corners. `;\n } else {\n explanation = `X-Wing found for digit ${digit}. `;\n explanation += `In Columns ${cols.map(c => c + 1).join(' and ')}, digit ${digit} appears only in Rows ${rows.map(r => r + 1).join(' and ')}. `;\n explanation += `This forms a rectangle where ${digit} must occupy two opposite corners. `;\n }\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Swordfish: A 3x3 fish pattern.\n */\nfunction explainSwordfish(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 6) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Swordfish found for digit ${digit}. `;\n explanation += `In Rows ${rows.map(r => r + 1).join(', ')}, digit ${digit} is restricted to Columns ${cols.map(c => c + 1).join(', ')}. `;\n explanation += `This 3×3 fish pattern means ${digit} must appear once per row in these columns. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from other cells in these columns: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Jellyfish: A 4x4 fish pattern.\n */\nfunction explainJellyfish(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 8) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Jellyfish found for digit ${digit}. `;\n explanation += `In Rows ${rows.map(r => r + 1).join(', ')}, digit ${digit} is restricted to Columns ${cols.map(c => c + 1).join(', ')}. `;\n explanation += `This 4×4 fish pattern locks ${digit} within these intersections. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from other cells in these columns: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Squirmbag: A 5x5 fish pattern.\n */\nfunction explainSquirmbag(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 10) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Squirmbag (5-fish) found for digit ${digit}. `;\n explanation += `Across Rows ${rows.map(r => r + 1).join(', ')}, digit ${digit} is confined to Columns ${cols.map(c => c + 1).join(', ')}. `;\n explanation += `This rare 5×5 fish pattern restricts ${digit} to these intersections. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * XY-Wing: Three cells forming a bent pattern with bivalve cells.\n */\nfunction explainXYWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 3) return hint.text;\n\n const cells = highlightCells\n .slice(0, 3)\n .map(c => ({ row: c.row, col: c.col }));\n const zDigit =\n removeCells.length > 0\n ? formatDigit(getFirstValidDigit(removeCells[0]?.digits))\n : '?';\n\n let explanation = `XY-Wing pattern found. `;\n explanation += `Three cells form a \"bent triple\": ${cellList(cells)}. `;\n explanation += `The pivot cell sees both wing cells, and each wing contains the digit ${zDigit}. `;\n explanation += `If the pivot takes one value, one wing gets ${zDigit}. If it takes the other, the other wing gets ${zDigit}. `;\n explanation += `Either way, ${zDigit} must appear in one of the wings. `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${zDigit} from cells that see both wings: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * XYZ-Wing: Similar to XY-Wing but pivot has 3 candidates (XYZ).\n */\nfunction explainXYZWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 3) return hint.text;\n\n const cells = highlightCells\n .slice(0, 3)\n .map(c => ({ row: c.row, col: c.col }));\n const zDigit =\n removeCells.length > 0\n ? formatDigit(getFirstValidDigit(removeCells[0]?.digits))\n : '?';\n\n let explanation = `XYZ-Wing pattern found. `;\n explanation += `The pivot cell has 3 candidates (XYZ), and two wing cells each have 2 candidates. `;\n explanation += `Cells: ${cellList(cells)}. `;\n explanation += `The digit ${zDigit} appears in all three pattern cells. `;\n explanation += `One of these cells MUST contain ${zDigit}. `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${zDigit} from cells that see all three: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * WXYZ-Wing: Four cells with four candidates total (WXYZ).\n */\nfunction explainWXYZWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const cells = highlightCells\n .slice(0, 4)\n .map(c => ({ row: c.row, col: c.col }));\n const elimDigit =\n removeCells.length > 0\n ? formatDigit(getFirstValidDigit(removeCells[0]?.digits))\n : '?';\n\n const allDigits = new Set<string>();\n highlightCells.slice(0, 4).forEach(c => {\n for (const d of getValidDigits(c.digits)) allDigits.add(d);\n });\n\n let explanation = `WXYZ-Wing pattern found. `;\n explanation += `Four cells ${cellList(cells)} contain exactly 4 candidates: ${formatDigits(Array.from(allDigits))}. `;\n explanation += `One of these cells must contain ${elimDigit}. `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${elimDigit} from cells that see all instances of ${elimDigit} in the pattern: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Finned X-Wing\n */\nfunction explainFinnedXWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Finned X-Wing for digit ${digit}. `;\n explanation += `An X-Wing pattern exists in Rows ${rows.map(r => r + 1).join(' and ')}, Columns ${cols\n .slice(0, 2)\n .map(c => c + 1)\n .join(' and ')}, `;\n explanation += `but with an extra \"fin\" candidate that breaks the perfect rectangle. `;\n explanation += `The fin limits eliminations to cells that see both the pattern and the fin. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\nfunction explainFinnedSwordfish(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 6) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Finned Swordfish for digit ${digit}. `;\n explanation += `A Swordfish pattern exists across Rows ${rows.map(r => r + 1).join(', ')}, `;\n explanation += `but with an extra \"fin\" that restricts eliminations. `;\n explanation += `Only cells seeing both the pattern and fin can have ${digit} eliminated. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\nfunction explainFinnedJellyfish(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 8) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Finned Jellyfish for digit ${digit}. `;\n explanation += `A Jellyfish pattern exists across Rows ${rows.map(r => r + 1).join(', ')}, `;\n explanation += `with an extra \"fin\" candidate. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\nfunction explainFinnedSquirmbag(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 10) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Finned Squirmbag (5-fish) for digit ${digit}. `;\n explanation += `A rare 5-fish pattern across Rows ${rows.map(r => r + 1).join(', ')}, with a fin. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Almost Locked Sets (ALS)\n */\nfunction explainAlmostLockedSets(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 2) return hint.text;\n\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their shared house';\n\n const alsDigits = new Set<string>();\n highlightCells.forEach(c => {\n for (const d of getValidDigits(c.digits)) alsDigits.add(d);\n });\n\n const n = highlightCells.length;\n const nPlus1 = alsDigits.size;\n\n let explanation = `Almost Locked Set (ALS) in ${houseName}. `;\n explanation += `Cells ${cellList(cells)} (${n} cells) contain ${nPlus1} candidates: ${formatDigits(Array.from(alsDigits))}. `;\n explanation += `Since there's one \"extra\" candidate, if ANY digit is removed externally, `;\n explanation += `the remaining ${n} candidates lock into these ${n} cells. `;\n\n if (removeCells.length > 0) {\n const elimDigits = new Set<string>();\n removeCells.forEach(c => {\n for (const d of getValidDigits(c.digits)) elimDigits.add(d);\n });\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${formatDigits(Array.from(elimDigits))} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * ALS-Chain (ALS-XZ)\n */\nfunction explainALSChain(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `ALS-XZ (ALS-Chain) pattern. `;\n explanation += `Two Almost Locked Sets share a Restricted Common Candidate (RCC). `;\n explanation += `Pattern cells: ${cellList(cells)}. `;\n explanation += `The RCC can only be true in one ALS, which forces the other ALS to become fully locked. `;\n\n if (removeCells.length > 0) {\n const elimDigits = new Set<string>();\n removeCells.forEach(c => {\n for (const d of getValidDigits(c.digits)) elimDigits.add(d);\n });\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${formatDigits(Array.from(elimDigits))} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Generic explanation for unknown or unsupported techniques.\n */\nfunction generateGenericExplanation(\n hint: SolverHintStep,\n selectCells: Array<{ row: number; col: number; digit: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n const parts: string[] = [];\n\n parts.push(hint.text);\n\n if (selectCells.length > 0) {\n const placements = selectCells.map(\n c => `${formatDigit(c.digit)} in ${cellName(c.row, c.col)}`\n );\n parts.push(`Place: ${placements.join(', ')}.`);\n }\n\n if (removeCells.length > 0) {\n const eliminations = removeCells.map(\n c => `${formatDigits(c.digits)} from ${cellName(c.row, c.col)}`\n );\n if (eliminations.length <= 5) {\n parts.push(`Eliminate: ${eliminations.join('; ')}.`);\n } else {\n parts.push(`Eliminate candidates from ${removeCells.length} cells.`);\n }\n }\n\n return parts.join(' ');\n}\n\n/**\n * Get a summary of the hint action (what to do)\n */\nexport function getHintActionSummary(\n hint: SolverHintStep,\n digitDisplay?: DigitDisplay,\n t?: TranslateFunction\n): string {\n _display = digitDisplay ?? 'numeric';\n if (!hint.cells) return '';\n const selectCells = getSelectCells(hint);\n const removeCells = getRemoveCells(hint);\n\n if (selectCells.length > 0) {\n if (selectCells.length === 1) {\n const c = selectCells[0];\n if (!c) {\n return t\n ? t('hintAction.placeDigit', { defaultValue: 'Place a digit' })\n : 'Place a digit';\n }\n const digit = formatDigit(c.digit);\n const cell = cellName(c.row, c.col);\n return t\n ? t('hintAction.placeInCell', {\n defaultValue: `Place ${digit} in ${cell}`,\n digit,\n cell,\n })\n : `Place ${digit} in ${cell}`;\n }\n const count = String(selectCells.length);\n return t\n ? t('hintAction.placeInCells', {\n defaultValue: `Place digits in ${count} cells`,\n count,\n })\n : `Place digits in ${selectCells.length} cells`;\n }\n\n if (removeCells.length > 0) {\n const allDigits = new Set<string>();\n removeCells.forEach(c => {\n for (const d of getValidDigits(c.digits)) allDigits.add(d);\n });\n const digits = formatDigits(Array.from(allDigits));\n const count = String(removeCells.length);\n const suffix = removeCells.length > 1 ? 's' : '';\n return t\n ? t('hintAction.eliminate', {\n defaultValue: `Eliminate ${digits} from ${count} cell${suffix}`,\n digits,\n count,\n })\n : `Eliminate ${digits} from ${count} cell${suffix}`;\n }\n\n return t\n ? t('hintAction.applyTechnique', {\n defaultValue: 'Apply the technique',\n })\n : 'Apply the technique';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"hintExplanation.js","sourceRoot":"","sources":["../../src/utils/hintExplanation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,oFAAoF;AACpF,IAAI,QAAQ,GAAiB,SAAS,CAAC;AAEvC,8BAA8B;AAC9B,SAAS,QAAQ,CAAC,GAAW,EAAE,GAAW;IACxC,OAAO,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;AAClC,CAAC;AAED,yBAAyB;AACzB,SAAS,QAAQ,CAAC,KAA0C;IAC1D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,iDAAiD;AACjD,yDAAyD;AACzD,SAAS,WAAW,CAAC,CAAkB;IACrC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG;QAAE,OAAO,GAAG,CAAC;IACnC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B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C5B,CAAC","sourcesContent":["/**\n * Generate detailed hint explanations based on the hint payload\n * Similar to tutorial explanations but for live hints\n *\n * Each explanation is designed to teach the user WHY the technique works,\n * not just WHAT to do.\n */\n\nimport type { SolverHintCell, SolverHintStep } from '@sudobility/sudojo_types';\nimport { TechniqueId } from '@sudobility/sudojo_types';\nimport type { DigitDisplay } from '../types/settings';\nimport { displayDigit as mapDigitDisplay } from './digitDisplay';\nimport type { TranslateFunction } from './localizedHint';\n\n// Module-level display format, set by public entry points before calling internals.\nlet _display: DigitDisplay = 'numeric';\n\n// Cell notation (R1C1 format)\nfunction cellName(row: number, col: number): string {\n return `R${row + 1}C${col + 1}`;\n}\n\n// Format a list of cells\nfunction cellList(cells: Array<{ row: number; col: number }>): string {\n return cells.map(c => cellName(c.row, c.col)).join(', ');\n}\n\n// Format digit(s) - only valid Sudoku digits 1-9\n// Uses module-level _display set by public entry points.\nfunction formatDigit(d: string | number): string {\n const s = String(d);\n if (s < '1' || s > '9') return '?';\n if (_display !== 'numeric') {\n return mapDigitDisplay(parseInt(s, 10), _display);\n }\n return s;\n}\n\n// Format multiple digits as set - only valid Sudoku digits 1-9\nfunction formatDigits(digits: string | string[]): string {\n const arr = Array.isArray(digits)\n ? digits.filter(d => d >= '1' && d <= '9')\n : digits.split('').filter(d => d >= '1' && d <= '9');\n if (arr.length === 0) return '';\n if (arr.length === 1) return formatDigit(arr[0] ?? '');\n return `{${arr\n .sort()\n .map(d => formatDigit(d))\n .join(', ')}}`;\n}\n\n// Extract first valid Sudoku digit (1-9) from a string\nfunction getFirstValidDigit(digits: string | undefined): string {\n if (!digits) return '?';\n for (const d of digits) {\n if (d >= '1' && d <= '9') return d;\n }\n return '?';\n}\n\n// Extract all valid Sudoku digits (1-9) from a string\nfunction getValidDigits(digits: string | undefined): string[] {\n if (!digits) return [];\n return digits.split('').filter(d => d >= '1' && d <= '9');\n}\n\n// Get block number (1-9) from row/col\nfunction getBlock(row: number, col: number): number {\n return Math.floor(row / 3) * 3 + Math.floor(col / 3) + 1;\n}\n\n// Determine the common house for cells\nfunction findCommonHouse(\n cells: Array<{ row: number; col: number }>\n): { type: 'row' | 'col' | 'block'; index: number; name: string } | null {\n const first = cells[0];\n if (cells.length < 2 || !first) return null;\n\n const sameRow = cells.every(c => c.row === first.row);\n if (sameRow) {\n return { type: 'row', index: first.row, name: `Row ${first.row + 1}` };\n }\n\n const sameCol = cells.every(c => c.col === first.col);\n if (sameCol) {\n return { type: 'col', index: first.col, name: `Column ${first.col + 1}` };\n }\n\n const sameBlock = cells.every(\n c => getBlock(c.row, c.col) === getBlock(first.row, first.col)\n );\n if (sameBlock) {\n const block = getBlock(first.row, first.col);\n return { type: 'block', index: block, name: `Block ${block}` };\n }\n\n return null;\n}\n\n// Extract cells that have select action (digit placement)\n// Note: select: \"0\" means no selection (placeholder), only 1-9 are valid digits\nfunction getSelectCells(\n hint: SolverHintStep\n): Array<{ row: number; col: number; digit: string }> {\n // cells is null on the solver's auto-pencilmark hint (technique 0)\n return (hint.cells ?? [])\n .filter(\n (c: SolverHintCell) =>\n c.actions.select && c.actions.select !== '' && c.actions.select !== '0'\n )\n .map((c: SolverHintCell) => ({\n row: c.row,\n col: c.column,\n digit: c.actions.select,\n }));\n}\n\n// Extract cells that have remove action (eliminations)\n// Note: Filter out cells where remove only contains \"0\" (placeholder)\nfunction getRemoveCells(\n hint: SolverHintStep\n): Array<{ row: number; col: number; digits: string }> {\n // cells is null on the solver's auto-pencilmark hint (technique 0)\n return (hint.cells ?? [])\n .filter(\n (c: SolverHintCell) =>\n c.actions.remove &&\n c.actions.remove !== '' &&\n getValidDigits(c.actions.remove).length > 0\n )\n .map((c: SolverHintCell) => ({\n row: c.row,\n col: c.column,\n digits: c.actions.remove,\n }));\n}\n\n// Extract cells that have highlight action (pattern cells)\n// Note: Filter out cells where highlight only contains \"0\" (placeholder)\nfunction getHighlightCells(\n hint: SolverHintStep\n): Array<{ row: number; col: number; digits: string }> {\n // cells is null on the solver's auto-pencilmark hint (technique 0)\n return (hint.cells ?? [])\n .filter(\n (c: SolverHintCell) =>\n c.actions.highlight &&\n c.actions.highlight !== '' &&\n getValidDigits(c.actions.highlight).length > 0\n )\n .map((c: SolverHintCell) => ({\n row: c.row,\n col: c.column,\n digits: c.actions.highlight,\n }));\n}\n\n/**\n * Generate detailed explanation for a hint\n *\n * @param hint - The hint step data\n * @param techniqueId - The technique ID (from SolverHints.technique)\n * @param digitDisplay - Optional digit display format\n */\nexport function generateDetailedExplanation(\n hint: SolverHintStep,\n techniqueId?: number,\n digitDisplay?: DigitDisplay\n): string {\n _display = digitDisplay ?? 'numeric';\n const selectCells = getSelectCells(hint);\n const removeCells = getRemoveCells(hint);\n const highlightCells = getHighlightCells(hint);\n\n switch (techniqueId) {\n case TechniqueId.FULL_HOUSE:\n return explainFullHouse(hint, selectCells);\n\n case TechniqueId.HIDDEN_SINGLE:\n return explainHiddenSingle(hint, selectCells);\n\n case TechniqueId.NAKED_SINGLE:\n return explainNakedSingle(hint, selectCells);\n\n case TechniqueId.HIDDEN_PAIR:\n return explainHiddenPair(hint, highlightCells, removeCells);\n\n case TechniqueId.NAKED_PAIR:\n return explainNakedPair(hint, highlightCells, removeCells);\n\n case TechniqueId.LOCKED_CANDIDATES:\n return explainLockedCandidates(hint, highlightCells, removeCells);\n\n case TechniqueId.HIDDEN_TRIPLE:\n return explainHiddenTriple(hint, highlightCells, removeCells);\n\n case TechniqueId.NAKED_TRIPLE:\n return explainNakedTriple(hint, highlightCells, removeCells);\n\n case TechniqueId.HIDDEN_QUAD:\n return explainHiddenQuad(hint, highlightCells, removeCells);\n\n case TechniqueId.NAKED_QUAD:\n return explainNakedQuad(hint, highlightCells, removeCells);\n\n case TechniqueId.X_WING:\n return explainXWing(hint, highlightCells, removeCells);\n\n case TechniqueId.SWORDFISH:\n return explainSwordfish(hint, highlightCells, removeCells);\n\n case TechniqueId.JELLYFISH:\n return explainJellyfish(hint, highlightCells, removeCells);\n\n case TechniqueId.XY_WING:\n return explainXYWing(hint, highlightCells, removeCells);\n\n case TechniqueId.FINNED_X_WING:\n return explainFinnedXWing(hint, highlightCells, removeCells);\n\n case TechniqueId.SQUIRMBAG:\n return explainSquirmbag(hint, highlightCells, removeCells);\n\n case TechniqueId.FINNED_SWORDFISH:\n return explainFinnedSwordfish(hint, highlightCells, removeCells);\n\n case TechniqueId.FINNED_JELLYFISH:\n return explainFinnedJellyfish(hint, highlightCells, removeCells);\n\n case TechniqueId.XYZ_WING:\n return explainXYZWing(hint, highlightCells, removeCells);\n\n case TechniqueId.WXYZ_WING:\n return explainWXYZWing(hint, highlightCells, removeCells);\n\n case TechniqueId.ALMOST_LOCKED_SETS:\n return explainAlmostLockedSets(hint, highlightCells, removeCells);\n\n case TechniqueId.FINNED_SQUIRMBAG:\n return explainFinnedSquirmbag(hint, highlightCells, removeCells);\n\n case TechniqueId.ALS_CHAIN:\n case TechniqueId.ALS_XZ:\n return explainALSChain(hint, highlightCells, removeCells);\n\n default:\n return generateGenericExplanation(hint, selectCells, removeCells);\n }\n}\n\n/**\n * Full House: The last empty cell in a house.\n */\nfunction explainFullHouse(\n hint: SolverHintStep,\n selectCells: Array<{ row: number; col: number; digit: string }>\n): string {\n if (selectCells.length !== 1) return hint.text;\n\n const cell = selectCells[0];\n if (!cell) return hint.text;\n const digit = formatDigit(cell.digit);\n\n const area = hint.areas?.[0];\n let houseName = '';\n if (area) {\n if (area.type === 'row') houseName = `Row ${area.index + 1}`;\n else if (area.type === 'column') houseName = `Column ${area.index + 1}`;\n else if (area.type === 'block') houseName = `Block ${area.index + 1}`;\n }\n\n if (houseName) {\n return (\n `${houseName} has 8 cells filled, leaving only ${cellName(cell.row, cell.col)} empty. ` +\n `The missing digit is ${digit} — place it here.`\n );\n }\n\n return (\n `Cell ${cellName(cell.row, cell.col)} is the only empty cell in its house. ` +\n `Place ${digit} here.`\n );\n}\n\n/**\n * Hidden Single: A digit that can only go in one cell within a house.\n */\nfunction explainHiddenSingle(\n hint: SolverHintStep,\n selectCells: Array<{ row: number; col: number; digit: string }>\n): string {\n if (selectCells.length !== 1) return hint.text;\n\n const cell = selectCells[0];\n if (!cell) return hint.text;\n const digit = formatDigit(cell.digit);\n\n const area = hint.areas?.[0];\n let houseName: string;\n if (area) {\n houseName =\n area.type === 'row'\n ? `Row ${area.index + 1}`\n : area.type === 'column'\n ? `Column ${area.index + 1}`\n : `Block ${area.index + 1}`;\n } else {\n houseName = `Block ${getBlock(cell.row, cell.col)}`;\n }\n\n return (\n `In ${houseName}, digit ${digit} can only go in one cell: ${cellName(cell.row, cell.col)}. ` +\n `Even though this cell may have other candidates, ${digit} has no other place in ${houseName.toLowerCase()}. ` +\n `Place ${digit} here.`\n );\n}\n\n/**\n * Naked Single: A cell with only one candidate remaining.\n */\nfunction explainNakedSingle(\n hint: SolverHintStep,\n selectCells: Array<{ row: number; col: number; digit: string }>\n): string {\n if (selectCells.length !== 1) return hint.text;\n\n const cell = selectCells[0];\n if (!cell) return hint.text;\n const digit = formatDigit(cell.digit);\n\n return (\n `Cell ${cellName(cell.row, cell.col)} has only one candidate left: ${digit}. ` +\n `All other digits are eliminated by numbers already placed in its row, column, and block. ` +\n `Place ${digit} here.`\n );\n}\n\n/**\n * Hidden Pair: Two digits that can only appear in exactly two cells within a house.\n */\nfunction explainHiddenPair(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 2) return hint.text;\n\n const cells = highlightCells\n .slice(0, 2)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const hiddenDigits = new Set<string>();\n highlightCells.slice(0, 2).forEach(c => {\n for (const d of getValidDigits(c.digits)) hiddenDigits.add(d);\n });\n const pairDigits = formatDigits(Array.from(hiddenDigits));\n\n const eliminations = removeCells.filter(c =>\n cells.some(hc => hc.row === c.row && hc.col === c.col)\n );\n\n let explanation = `In ${houseName}, digits ${pairDigits} can ONLY appear in ${cellList(cells)}. `;\n explanation += `These form a Hidden Pair — the pair is \"hidden\" among other candidates. `;\n explanation += `Since ${pairDigits} must occupy these 2 cells, `;\n\n if (eliminations.length > 0) {\n const elimDigits = new Set<string>();\n eliminations.forEach(e => {\n for (const d of getValidDigits(e.digits)) elimDigits.add(d);\n });\n explanation += `eliminate the other candidates ${formatDigits(Array.from(elimDigits))} from these cells.`;\n } else {\n explanation += `other candidates can be eliminated.`;\n }\n\n return explanation;\n}\n\n/**\n * Naked Pair: Two cells in a house that contain exactly the same two candidates.\n */\nfunction explainNakedPair(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 2) return hint.text;\n\n const cells = highlightCells\n .slice(0, 2)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their shared house';\n\n const pairDigits = formatDigits(getValidDigits(highlightCells[0]?.digits));\n\n let explanation = `Cells ${cellList(cells)} both contain exactly ${pairDigits} as their only candidates. `;\n explanation += `This is a Naked Pair — the pair is \"naked\" because these cells show only these digits. `;\n explanation += `Since ${pairDigits} must go in these cells, `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells\n .filter(c => !cells.some(pc => pc.row === c.row && pc.col === c.col))\n .map(c => ({ row: c.row, col: c.col }));\n if (elimCells.length > 0) {\n explanation += `eliminate ${pairDigits} from other cells in ${houseName.toLowerCase()}: ${cellList(elimCells)}.`;\n } else {\n explanation += `they can be eliminated from other cells in the house.`;\n }\n }\n\n return explanation;\n}\n\n/**\n * Locked Candidates (Pointing/Claiming)\n */\nfunction explainLockedCandidates(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 2) return hint.text;\n\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const first = cells[0];\n if (!first) return hint.text;\n const lockedDigit = formatDigit(\n getFirstValidDigit(highlightCells[0]?.digits)\n );\n\n const sameRow = cells.every(c => c.row === first.row);\n const sameCol = cells.every(c => c.col === first.col);\n const sameBlock = cells.every(\n c => getBlock(c.row, c.col) === getBlock(first.row, first.col)\n );\n\n const block = getBlock(first.row, first.col);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n const elimInSameBlock = elimCells.every(\n c => getBlock(c.row, c.col) === block\n );\n\n let explanation = '';\n\n if (sameBlock && (sameRow || sameCol)) {\n if (elimInSameBlock) {\n const lineName = sameRow\n ? `Row ${first.row + 1}`\n : `Column ${first.col + 1}`;\n explanation = `In ${lineName}, digit ${lockedDigit} can only appear in Block ${block} (cells ${cellList(cells)}). `;\n explanation += `This \"claims\" ${lockedDigit} for this line within the block. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from other cells in Block ${block}: ${cellList(elimCells)}.`;\n }\n } else {\n const lineName = sameRow\n ? `Row ${first.row + 1}`\n : `Column ${first.col + 1}`;\n explanation = `In Block ${block}, digit ${lockedDigit} can only appear in ${lineName} (cells ${cellList(cells)}). `;\n explanation += `This \"points\" to ${lockedDigit} being restricted to this line. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from ${cellList(elimCells)} in ${lineName} outside Block ${block}.`;\n }\n }\n } else if (sameRow) {\n explanation = `Digit ${lockedDigit} is locked to Row ${first.row + 1} in these cells: ${cellList(cells)}. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from ${cellList(elimCells)}.`;\n }\n } else if (sameCol) {\n explanation = `Digit ${lockedDigit} is locked to Column ${first.col + 1} in these cells: ${cellList(cells)}. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from ${cellList(elimCells)}.`;\n }\n } else {\n explanation = `Locked Candidates pattern for digit ${lockedDigit}. `;\n if (elimCells.length > 0) {\n explanation += `Eliminate ${lockedDigit} from ${cellList(elimCells)}.`;\n }\n }\n\n return explanation;\n}\n\n/**\n * Hidden Triple: Three digits that can only appear in exactly three cells within a house.\n */\nfunction explainHiddenTriple(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 3) return hint.text;\n\n const cells = highlightCells\n .slice(0, 3)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const hiddenDigits = new Set<string>();\n highlightCells.slice(0, 3).forEach(c => {\n for (const d of getValidDigits(c.digits)) hiddenDigits.add(d);\n });\n const tripleDigits = formatDigits(Array.from(hiddenDigits));\n\n let explanation = `In ${houseName}, digits ${tripleDigits} can ONLY appear in cells ${cellList(cells)}. `;\n explanation += `This is a Hidden Triple — these 3 digits are \"hidden\" among other candidates. `;\n explanation += `Since ${tripleDigits} must occupy these 3 cells, `;\n\n if (removeCells.length > 0) {\n const elimDigits = new Set<string>();\n removeCells\n .filter(c => cells.some(hc => hc.row === c.row && hc.col === c.col))\n .forEach(e => {\n for (const d of getValidDigits(e.digits)) elimDigits.add(d);\n });\n if (elimDigits.size > 0) {\n explanation += `eliminate the other candidates ${formatDigits(Array.from(elimDigits))} from these cells.`;\n } else {\n explanation += `other candidates can be eliminated.`;\n }\n } else {\n explanation += `other candidates can be eliminated.`;\n }\n\n return explanation;\n}\n\n/**\n * Naked Triple: Three cells in a house that together contain only three candidates total.\n */\nfunction explainNakedTriple(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 3) return hint.text;\n\n const cells = highlightCells\n .slice(0, 3)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const nakedDigits = new Set<string>();\n highlightCells.slice(0, 3).forEach(c => {\n for (const d of getValidDigits(c.digits)) nakedDigits.add(d);\n });\n const tripleDigits = formatDigits(Array.from(nakedDigits));\n\n let explanation = `Cells ${cellList(cells)} together contain only the candidates ${tripleDigits}. `;\n explanation += `This is a Naked Triple — these 3 cells share only 3 digits between them. `;\n explanation += `Since ${tripleDigits} must go in these cells, `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.filter(\n c => !cells.some(nc => nc.row === c.row && nc.col === c.col)\n );\n if (elimCells.length > 0) {\n explanation += `eliminate ${tripleDigits} from other cells in ${houseName.toLowerCase()}: ${cellList(elimCells.map(c => ({ row: c.row, col: c.col })))}.`;\n } else {\n explanation += `they can be eliminated from other cells.`;\n }\n } else {\n explanation += `they can be eliminated from other cells.`;\n }\n\n return explanation;\n}\n\n/**\n * Hidden Quad: Four digits that can only appear in exactly four cells within a house.\n */\nfunction explainHiddenQuad(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const cells = highlightCells\n .slice(0, 4)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const hiddenDigits = new Set<string>();\n highlightCells.slice(0, 4).forEach(c => {\n for (const d of getValidDigits(c.digits)) hiddenDigits.add(d);\n });\n const quadDigits = formatDigits(Array.from(hiddenDigits));\n\n let explanation = `In ${houseName}, digits ${quadDigits} can ONLY appear in cells ${cellList(cells)}. `;\n explanation += `This is a Hidden Quad — 4 digits restricted to 4 cells. `;\n\n if (removeCells.length > 0) {\n const elimDigits = new Set<string>();\n removeCells\n .filter(c => cells.some(hc => hc.row === c.row && hc.col === c.col))\n .forEach(e => {\n for (const d of getValidDigits(e.digits)) elimDigits.add(d);\n });\n if (elimDigits.size > 0) {\n explanation += `Eliminate the other candidates ${formatDigits(Array.from(elimDigits))} from these cells.`;\n }\n }\n\n return explanation;\n}\n\n/**\n * Naked Quad: Four cells in a house that together contain only four candidates total.\n */\nfunction explainNakedQuad(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const cells = highlightCells\n .slice(0, 4)\n .map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their house';\n\n const nakedDigits = new Set<string>();\n highlightCells.slice(0, 4).forEach(c => {\n for (const d of getValidDigits(c.digits)) nakedDigits.add(d);\n });\n const quadDigits = formatDigits(Array.from(nakedDigits));\n\n let explanation = `Cells ${cellList(cells)} together contain only the candidates ${quadDigits}. `;\n explanation += `This is a Naked Quad — 4 cells sharing only 4 digits. `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.filter(\n c => !cells.some(nc => nc.row === c.row && nc.col === c.col)\n );\n if (elimCells.length > 0) {\n explanation += `Eliminate ${quadDigits} from other cells in ${houseName.toLowerCase()}: ${cellList(elimCells.map(c => ({ row: c.row, col: c.col })))}.`;\n }\n }\n\n return explanation;\n}\n\n/**\n * X-Wing: A 2x2 fish pattern.\n */\nfunction explainXWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n const elimInCols =\n elimCells.length > 0 && elimCells.every(c => cols.includes(c.col));\n\n let explanation = '';\n if (elimInCols || rows.length === 2) {\n explanation = `X-Wing found for digit ${digit}. `;\n explanation += `In Rows ${rows.map(r => r + 1).join(' and ')}, digit ${digit} appears only in Columns ${cols.map(c => c + 1).join(' and ')}. `;\n explanation += `This forms a rectangle where ${digit} must occupy two opposite corners. `;\n } else {\n explanation = `X-Wing found for digit ${digit}. `;\n explanation += `In Columns ${cols.map(c => c + 1).join(' and ')}, digit ${digit} appears only in Rows ${rows.map(r => r + 1).join(' and ')}. `;\n explanation += `This forms a rectangle where ${digit} must occupy two opposite corners. `;\n }\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Swordfish: A 3x3 fish pattern.\n */\nfunction explainSwordfish(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 6) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Swordfish found for digit ${digit}. `;\n explanation += `In Rows ${rows.map(r => r + 1).join(', ')}, digit ${digit} is restricted to Columns ${cols.map(c => c + 1).join(', ')}. `;\n explanation += `This 3×3 fish pattern means ${digit} must appear once per row in these columns. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from other cells in these columns: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Jellyfish: A 4x4 fish pattern.\n */\nfunction explainJellyfish(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 8) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Jellyfish found for digit ${digit}. `;\n explanation += `In Rows ${rows.map(r => r + 1).join(', ')}, digit ${digit} is restricted to Columns ${cols.map(c => c + 1).join(', ')}. `;\n explanation += `This 4×4 fish pattern locks ${digit} within these intersections. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from other cells in these columns: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Squirmbag: A 5x5 fish pattern.\n */\nfunction explainSquirmbag(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 10) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Squirmbag (5-fish) found for digit ${digit}. `;\n explanation += `Across Rows ${rows.map(r => r + 1).join(', ')}, digit ${digit} is confined to Columns ${cols.map(c => c + 1).join(', ')}. `;\n explanation += `This rare 5×5 fish pattern restricts ${digit} to these intersections. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * XY-Wing: Three cells forming a bent pattern with bivalve cells.\n */\nfunction explainXYWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 3) return hint.text;\n\n const cells = highlightCells\n .slice(0, 3)\n .map(c => ({ row: c.row, col: c.col }));\n const zDigit =\n removeCells.length > 0\n ? formatDigit(getFirstValidDigit(removeCells[0]?.digits))\n : '?';\n\n let explanation = `XY-Wing pattern found. `;\n explanation += `Three cells form a \"bent triple\": ${cellList(cells)}. `;\n explanation += `The pivot cell sees both wing cells, and each wing contains the digit ${zDigit}. `;\n explanation += `If the pivot takes one value, one wing gets ${zDigit}. If it takes the other, the other wing gets ${zDigit}. `;\n explanation += `Either way, ${zDigit} must appear in one of the wings. `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${zDigit} from cells that see both wings: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * XYZ-Wing: Similar to XY-Wing but pivot has 3 candidates (XYZ).\n */\nfunction explainXYZWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 3) return hint.text;\n\n const cells = highlightCells\n .slice(0, 3)\n .map(c => ({ row: c.row, col: c.col }));\n const zDigit =\n removeCells.length > 0\n ? formatDigit(getFirstValidDigit(removeCells[0]?.digits))\n : '?';\n\n let explanation = `XYZ-Wing pattern found. `;\n explanation += `The pivot cell has 3 candidates (XYZ), and two wing cells each have 2 candidates. `;\n explanation += `Cells: ${cellList(cells)}. `;\n explanation += `The digit ${zDigit} appears in all three pattern cells. `;\n explanation += `One of these cells MUST contain ${zDigit}. `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${zDigit} from cells that see all three: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * WXYZ-Wing: Four cells with four candidates total (WXYZ).\n */\nfunction explainWXYZWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const cells = highlightCells\n .slice(0, 4)\n .map(c => ({ row: c.row, col: c.col }));\n const elimDigit =\n removeCells.length > 0\n ? formatDigit(getFirstValidDigit(removeCells[0]?.digits))\n : '?';\n\n const allDigits = new Set<string>();\n highlightCells.slice(0, 4).forEach(c => {\n for (const d of getValidDigits(c.digits)) allDigits.add(d);\n });\n\n let explanation = `WXYZ-Wing pattern found. `;\n explanation += `Four cells ${cellList(cells)} contain exactly 4 candidates: ${formatDigits(Array.from(allDigits))}. `;\n explanation += `One of these cells must contain ${elimDigit}. `;\n\n if (removeCells.length > 0) {\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${elimDigit} from cells that see all instances of ${elimDigit} in the pattern: ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Finned X-Wing\n */\nfunction explainFinnedXWing(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const cols = [...new Set(cells.map(c => c.col))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Finned X-Wing for digit ${digit}. `;\n explanation += `An X-Wing pattern exists in Rows ${rows.map(r => r + 1).join(' and ')}, Columns ${cols\n .slice(0, 2)\n .map(c => c + 1)\n .join(' and ')}, `;\n explanation += `but with an extra \"fin\" candidate that breaks the perfect rectangle. `;\n explanation += `The fin limits eliminations to cells that see both the pattern and the fin. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\nfunction explainFinnedSwordfish(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 6) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Finned Swordfish for digit ${digit}. `;\n explanation += `A Swordfish pattern exists across Rows ${rows.map(r => r + 1).join(', ')}, `;\n explanation += `but with an extra \"fin\" that restricts eliminations. `;\n explanation += `Only cells seeing both the pattern and fin can have ${digit} eliminated. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\nfunction explainFinnedJellyfish(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 8) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Finned Jellyfish for digit ${digit}. `;\n explanation += `A Jellyfish pattern exists across Rows ${rows.map(r => r + 1).join(', ')}, `;\n explanation += `with an extra \"fin\" candidate. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\nfunction explainFinnedSquirmbag(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 10) return hint.text;\n\n const digit = formatDigit(getFirstValidDigit(highlightCells[0]?.digits));\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const rows = [...new Set(cells.map(c => c.row))].sort((a, b) => a - b);\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `Finned Squirmbag (5-fish) for digit ${digit}. `;\n explanation += `A rare 5-fish pattern across Rows ${rows.map(r => r + 1).join(', ')}, with a fin. `;\n\n if (elimCells.length > 0) {\n explanation += `Eliminate ${digit} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Almost Locked Sets (ALS)\n */\nfunction explainAlmostLockedSets(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 2) return hint.text;\n\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n const house = findCommonHouse(cells);\n const houseName = house?.name || 'their shared house';\n\n const alsDigits = new Set<string>();\n highlightCells.forEach(c => {\n for (const d of getValidDigits(c.digits)) alsDigits.add(d);\n });\n\n const n = highlightCells.length;\n const nPlus1 = alsDigits.size;\n\n let explanation = `Almost Locked Set (ALS) in ${houseName}. `;\n explanation += `Cells ${cellList(cells)} (${n} cells) contain ${nPlus1} candidates: ${formatDigits(Array.from(alsDigits))}. `;\n explanation += `Since there's one \"extra\" candidate, if ANY digit is removed externally, `;\n explanation += `the remaining ${n} candidates lock into these ${n} cells. `;\n\n if (removeCells.length > 0) {\n const elimDigits = new Set<string>();\n removeCells.forEach(c => {\n for (const d of getValidDigits(c.digits)) elimDigits.add(d);\n });\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${formatDigits(Array.from(elimDigits))} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * ALS-Chain (ALS-XZ)\n */\nfunction explainALSChain(\n hint: SolverHintStep,\n highlightCells: Array<{ row: number; col: number; digits: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n if (highlightCells.length < 4) return hint.text;\n\n const cells = highlightCells.map(c => ({ row: c.row, col: c.col }));\n\n let explanation = `ALS-XZ (ALS-Chain) pattern. `;\n explanation += `Two Almost Locked Sets share a Restricted Common Candidate (RCC). `;\n explanation += `Pattern cells: ${cellList(cells)}. `;\n explanation += `The RCC can only be true in one ALS, which forces the other ALS to become fully locked. `;\n\n if (removeCells.length > 0) {\n const elimDigits = new Set<string>();\n removeCells.forEach(c => {\n for (const d of getValidDigits(c.digits)) elimDigits.add(d);\n });\n const elimCells = removeCells.map(c => ({ row: c.row, col: c.col }));\n explanation += `Eliminate ${formatDigits(Array.from(elimDigits))} from ${cellList(elimCells)}.`;\n }\n\n return explanation;\n}\n\n/**\n * Generic explanation for unknown or unsupported techniques.\n */\nfunction generateGenericExplanation(\n hint: SolverHintStep,\n selectCells: Array<{ row: number; col: number; digit: string }>,\n removeCells: Array<{ row: number; col: number; digits: string }>\n): string {\n const parts: string[] = [];\n\n parts.push(hint.text);\n\n if (selectCells.length > 0) {\n const placements = selectCells.map(\n c => `${formatDigit(c.digit)} in ${cellName(c.row, c.col)}`\n );\n parts.push(`Place: ${placements.join(', ')}.`);\n }\n\n if (removeCells.length > 0) {\n const eliminations = removeCells.map(\n c => `${formatDigits(c.digits)} from ${cellName(c.row, c.col)}`\n );\n if (eliminations.length <= 5) {\n parts.push(`Eliminate: ${eliminations.join('; ')}.`);\n } else {\n parts.push(`Eliminate candidates from ${removeCells.length} cells.`);\n }\n }\n\n return parts.join(' ');\n}\n\n/**\n * Get a summary of the hint action (what to do)\n */\nexport function getHintActionSummary(\n hint: SolverHintStep,\n digitDisplay?: DigitDisplay,\n t?: TranslateFunction\n): string {\n _display = digitDisplay ?? 'numeric';\n if (!hint.cells) return '';\n const selectCells = getSelectCells(hint);\n const removeCells = getRemoveCells(hint);\n\n if (selectCells.length > 0) {\n if (selectCells.length === 1) {\n const c = selectCells[0];\n if (!c) {\n return t\n ? t('hintAction.placeDigit', { defaultValue: 'Place a digit' })\n : 'Place a digit';\n }\n const digit = formatDigit(c.digit);\n const cell = cellName(c.row, c.col);\n return t\n ? t('hintAction.placeInCell', {\n defaultValue: `Place ${digit} in ${cell}`,\n digit,\n cell,\n })\n : `Place ${digit} in ${cell}`;\n }\n const count = String(selectCells.length);\n return t\n ? t('hintAction.placeInCells', {\n defaultValue: `Place digits in ${count} cells`,\n count,\n })\n : `Place digits in ${selectCells.length} cells`;\n }\n\n if (removeCells.length > 0) {\n const allDigits = new Set<string>();\n removeCells.forEach(c => {\n for (const d of getValidDigits(c.digits)) allDigits.add(d);\n });\n const digits = formatDigits(Array.from(allDigits));\n const count = String(removeCells.length);\n const suffix = removeCells.length > 1 ? 's' : '';\n return t\n ? t('hintAction.eliminate', {\n defaultValue: `Eliminate ${digits} from ${count} cell${suffix}`,\n digits,\n count,\n })\n : `Eliminate ${digits} from ${count} cell${suffix}`;\n }\n\n return t\n ? t('hintAction.applyTechnique', {\n defaultValue: 'Apply the technique',\n })\n : 'Apply the technique';\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/sudojo_lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.194",
|
|
4
4
|
"description": "Business logic library for Sudojo app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"license": "BUSL-1.1",
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@sudobility/di": "^1.5.65",
|
|
50
|
-
"@sudobility/sudojo_client": "^0.0.
|
|
51
|
-
"@sudobility/sudojo_types": "^1.2.
|
|
50
|
+
"@sudobility/sudojo_client": "^0.0.153",
|
|
51
|
+
"@sudobility/sudojo_types": "^1.2.68",
|
|
52
52
|
"@sudobility/types": "^1.9.67",
|
|
53
53
|
"@tanstack/react-query": "^5.90.11",
|
|
54
54
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@sudobility/di": "^1.5.65",
|
|
76
|
-
"@sudobility/sudojo_client": "^0.0.
|
|
77
|
-
"@sudobility/sudojo_types": "^1.2.
|
|
76
|
+
"@sudobility/sudojo_client": "^0.0.153",
|
|
77
|
+
"@sudobility/sudojo_types": "^1.2.68",
|
|
78
78
|
"@sudobility/types": "^1.9.67",
|
|
79
79
|
"@tanstack/react-query": ">=5.0.0",
|
|
80
80
|
"react": ">=18.0.0",
|