@fgv/ts-sudoku-lib 5.0.1-0 → 5.0.1-10
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/debug_killer.js +50 -0
- package/debug_test.js +88 -0
- package/dist/index.browser.js +37 -0
- package/dist/index.js +30 -0
- package/dist/packlets/collections/collections.js +136 -0
- package/dist/packlets/collections/data/puzzles.json +56 -0
- package/dist/packlets/collections/index.js +25 -0
- package/dist/packlets/common/cage.js +83 -0
- package/dist/packlets/common/cell.js +88 -0
- package/dist/packlets/common/common.js +70 -0
- package/dist/packlets/common/converters.js +65 -0
- package/dist/packlets/common/ids.js +152 -0
- package/dist/packlets/common/index.js +36 -0
- package/dist/packlets/common/logging.js +32 -0
- package/dist/packlets/common/public.js +25 -0
- package/dist/packlets/common/puzzle.js +411 -0
- package/dist/packlets/common/puzzleDefinitions.js +247 -0
- package/dist/packlets/common/puzzleSession.js +369 -0
- package/dist/packlets/common/puzzleState.js +99 -0
- package/dist/packlets/files/converters.js +67 -0
- package/dist/packlets/files/fileTreeHelpers.js +37 -0
- package/dist/packlets/files/filesystem.js +37 -0
- package/dist/packlets/files/index.browser.js +32 -0
- package/dist/packlets/files/index.js +30 -0
- package/dist/packlets/files/model.js +25 -0
- package/dist/packlets/hints/baseHintProvider.js +199 -0
- package/dist/packlets/hints/explanations.js +270 -0
- package/dist/packlets/hints/hiddenSingles.js +233 -0
- package/dist/packlets/hints/hintRegistry.js +222 -0
- package/dist/packlets/hints/hints.js +311 -0
- package/dist/packlets/hints/index.js +39 -0
- package/dist/packlets/hints/interfaces.js +25 -0
- package/dist/packlets/hints/nakedSingles.js +198 -0
- package/dist/packlets/hints/puzzleSessionHints.js +495 -0
- package/dist/packlets/hints/types.js +43 -0
- package/dist/packlets/puzzles/anyPuzzle.js +47 -0
- package/dist/packlets/puzzles/index.js +31 -0
- package/dist/packlets/puzzles/internal/combinationCache.js +75 -0
- package/dist/packlets/puzzles/internal/combinationGenerator.js +142 -0
- package/dist/packlets/puzzles/internal/possibilityAnalyzer.js +121 -0
- package/dist/packlets/puzzles/killerCombinations.js +222 -0
- package/dist/packlets/puzzles/killerCombinationsTypes.js +25 -0
- package/dist/packlets/puzzles/killerSudokuPuzzle.js +136 -0
- package/dist/packlets/puzzles/sudokuPuzzle.js +43 -0
- package/dist/packlets/puzzles/sudokuXPuzzle.js +65 -0
- package/dist/test/unit/helpers/puzzleBuilders.js +149 -0
- package/dist/ts-sudoku-lib.d.ts +1515 -47
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/index.browser.d.ts +7 -0
- package/lib/index.browser.js +78 -0
- package/lib/index.d.ts +3 -2
- package/lib/index.js +5 -3
- package/lib/packlets/collections/collections.d.ts +15 -8
- package/lib/packlets/collections/collections.js +41 -11
- package/lib/packlets/collections/data/puzzles.json +28 -33
- package/lib/packlets/common/common.d.ts +15 -0
- package/lib/packlets/common/common.js +25 -0
- package/lib/packlets/common/converters.d.ts +0 -6
- package/lib/packlets/common/converters.js +17 -22
- package/lib/packlets/common/ids.d.ts +8 -1
- package/lib/packlets/common/ids.js +83 -10
- package/lib/packlets/common/index.d.ts +3 -2
- package/lib/packlets/common/index.js +5 -2
- package/lib/packlets/common/logging.d.ts +7 -0
- package/lib/packlets/common/logging.js +35 -0
- package/lib/packlets/common/puzzle.d.ts +23 -13
- package/lib/packlets/common/puzzle.js +51 -25
- package/lib/packlets/common/puzzleDefinitions.d.ts +127 -0
- package/lib/packlets/common/puzzleDefinitions.js +251 -0
- package/lib/packlets/common/puzzleSession.d.ts +8 -0
- package/lib/packlets/common/puzzleSession.js +12 -0
- package/lib/packlets/common/puzzleState.js +3 -0
- package/lib/packlets/files/converters.d.ts +27 -0
- package/lib/packlets/files/converters.js +71 -0
- package/lib/packlets/files/fileTreeHelpers.d.ts +13 -0
- package/lib/packlets/files/fileTreeHelpers.js +40 -0
- package/lib/packlets/{file/converters.d.ts → files/filesystem.d.ts} +3 -8
- package/lib/packlets/{file/converters.js → files/filesystem.js} +5 -14
- package/lib/packlets/{file/index.d.ts → files/index.browser.d.ts} +2 -1
- package/lib/packlets/{file/index.js → files/index.browser.js} +9 -3
- package/lib/packlets/files/index.d.ts +6 -0
- package/lib/packlets/files/index.js +69 -0
- package/lib/packlets/files/model.d.ts +32 -0
- package/lib/packlets/hints/baseHintProvider.d.ts +103 -0
- package/lib/packlets/hints/baseHintProvider.js +203 -0
- package/lib/packlets/hints/explanations.d.ts +105 -0
- package/lib/packlets/hints/explanations.js +276 -0
- package/lib/packlets/hints/hiddenSingles.d.ts +81 -0
- package/lib/packlets/hints/hiddenSingles.js +237 -0
- package/lib/packlets/hints/hintRegistry.d.ts +95 -0
- package/lib/packlets/hints/hintRegistry.js +226 -0
- package/lib/packlets/hints/hints.d.ts +144 -0
- package/lib/packlets/hints/hints.js +316 -0
- package/lib/packlets/hints/index.d.ts +10 -0
- package/lib/packlets/hints/index.js +55 -0
- package/lib/packlets/hints/interfaces.d.ts +121 -0
- package/lib/packlets/{file/model.js → hints/interfaces.js} +1 -1
- package/lib/packlets/hints/nakedSingles.d.ts +57 -0
- package/lib/packlets/hints/nakedSingles.js +202 -0
- package/lib/packlets/hints/puzzleSessionHints.d.ts +306 -0
- package/lib/packlets/hints/puzzleSessionHints.js +499 -0
- package/lib/packlets/hints/types.d.ts +102 -0
- package/lib/packlets/hints/types.js +46 -0
- package/lib/packlets/puzzles/anyPuzzle.d.ts +3 -3
- package/lib/packlets/puzzles/anyPuzzle.js +1 -1
- package/lib/packlets/puzzles/index.d.ts +4 -2
- package/lib/packlets/puzzles/index.js +20 -3
- package/lib/packlets/puzzles/internal/combinationCache.d.ts +29 -0
- package/lib/packlets/puzzles/internal/combinationCache.js +79 -0
- package/lib/packlets/puzzles/internal/combinationGenerator.d.ts +34 -0
- package/lib/packlets/puzzles/internal/combinationGenerator.js +146 -0
- package/lib/packlets/puzzles/internal/possibilityAnalyzer.d.ts +25 -0
- package/lib/packlets/puzzles/internal/possibilityAnalyzer.js +125 -0
- package/lib/packlets/puzzles/killerCombinations.d.ts +90 -0
- package/lib/packlets/puzzles/killerCombinations.js +226 -0
- package/lib/packlets/puzzles/killerCombinationsTypes.d.ts +17 -0
- package/lib/packlets/puzzles/killerCombinationsTypes.js +26 -0
- package/lib/packlets/puzzles/killerSudokuPuzzle.d.ts +2 -2
- package/lib/packlets/puzzles/killerSudokuPuzzle.js +15 -11
- package/lib/packlets/puzzles/sudokuPuzzle.d.ts +2 -2
- package/lib/packlets/puzzles/sudokuXPuzzle.d.ts +2 -2
- package/lib/packlets/puzzles/sudokuXPuzzle.js +8 -4
- package/package.json +32 -18
- package/sample-12x12-puzzle.js +72 -0
- package/sample-4x4-puzzles.js +68 -0
- package/sample-6x6-puzzle.js +61 -0
- package/temp_12x12_cells.txt +12 -0
- package/temp_correct.txt +12 -0
- package/test-grid-sizes.js +132 -0
- package/lib/packlets/common/model.d.ts +0 -15
- package/lib/packlets/file/model.d.ts +0 -9
- /package/lib/packlets/{common → files}/model.js +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2023 Erik Fortune
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import { Converters, fail, succeed } from '@fgv/ts-utils';
|
|
25
|
+
import { allPuzzleTypes } from './common';
|
|
26
|
+
// Updated to support larger grids:
|
|
27
|
+
// - Row IDs: R followed by A-Z or AA-ZZ for rows
|
|
28
|
+
// - Column IDs: C followed by 1-99+ for columns
|
|
29
|
+
// - Section IDs: S followed by row letter(s) and column number(s)
|
|
30
|
+
// - X diagonals: X1, X2
|
|
31
|
+
// - Killer cages: K followed by letter(s)
|
|
32
|
+
const cageIdRegExp = /^(R[A-Z]{1,2}$)|(C[0-9]{1,3}$)|(S[A-Z]{1,2}[0-9]{1,3}$)|(X[1-2]$)|(K[A-Za-z]+$)/;
|
|
33
|
+
function validateCageId(from) {
|
|
34
|
+
if (cageIdRegExp.test(from)) {
|
|
35
|
+
return succeed(from);
|
|
36
|
+
}
|
|
37
|
+
return fail(`malformed cage ID "${from}"`);
|
|
38
|
+
}
|
|
39
|
+
// Updated to support larger grids:
|
|
40
|
+
// - Rows: A-Z for 0-25, then AA-ZZ for 26+
|
|
41
|
+
// - Columns: 1-999 for any size grid
|
|
42
|
+
const cellIdRegExp = /^[A-Z]{1,2}[0-9]{1,3}$/;
|
|
43
|
+
function validateCellId(from) {
|
|
44
|
+
// Check basic format
|
|
45
|
+
if (!cellIdRegExp.test(from)) {
|
|
46
|
+
return fail(`malformed cell ID "${from}" (expected row letter(s) followed by column number)`);
|
|
47
|
+
}
|
|
48
|
+
return succeed(from);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Converts an arbitrary value to a {@link CageId | CageId}.
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export const cageId = Converters.string.map(validateCageId);
|
|
55
|
+
/**
|
|
56
|
+
* Converts an arbitrary value to a {@link CellId | CellId}.
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
export const cellId = Converters.string.map(validateCellId);
|
|
60
|
+
/**
|
|
61
|
+
* Converts an arbitrary value to a {@link PuzzleType | PuzzleType}.
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export const puzzleType = Converters.enumeratedValue(allPuzzleTypes);
|
|
65
|
+
//# sourceMappingURL=converters.js.map
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2023 Erik Fortune
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import { fail, succeed } from '@fgv/ts-utils';
|
|
25
|
+
import * as Converters from './converters';
|
|
26
|
+
const firstRowIdChar = 'A'.charCodeAt(0);
|
|
27
|
+
/**
|
|
28
|
+
* Convert a column index (0-based) to column letters (A-Z, AA-AZ, BA-BZ, etc.)
|
|
29
|
+
* @param col - 0-based column index
|
|
30
|
+
* @returns Column identifier string
|
|
31
|
+
*/
|
|
32
|
+
function columnToLetters(col) {
|
|
33
|
+
if (col < 26) {
|
|
34
|
+
// Single letter: A-Z
|
|
35
|
+
return String.fromCharCode(firstRowIdChar + col);
|
|
36
|
+
/* c8 ignore next 8 - functional code tested but coverage intermittently missed */
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// Double letters: AA, AB, ..., ZZ
|
|
40
|
+
const firstLetter = Math.floor(col / 26) - 1;
|
|
41
|
+
const secondLetter = col % 26;
|
|
42
|
+
return (String.fromCharCode(firstRowIdChar + firstLetter) + String.fromCharCode(firstRowIdChar + secondLetter));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Convert a row index (0-based) to row number string (1-based with zero-padding)
|
|
47
|
+
* @param row - 0-based row index
|
|
48
|
+
* @param maxRow - Maximum row index (optional, for determining padding width)
|
|
49
|
+
* @returns Row number string with zero-padding
|
|
50
|
+
*/
|
|
51
|
+
function rowToNumber(row, maxRow) {
|
|
52
|
+
const rowNum = row + 1;
|
|
53
|
+
/* c8 ignore next 5 - functional code tested but coverage intermittently missed */
|
|
54
|
+
if (maxRow !== undefined) {
|
|
55
|
+
const maxRowNum = maxRow + 1;
|
|
56
|
+
const width = maxRowNum.toString().length;
|
|
57
|
+
return rowNum.toString().padStart(width, '0');
|
|
58
|
+
}
|
|
59
|
+
// Default: pad to 2 digits for grids up to 99x99
|
|
60
|
+
return rowNum.toString().padStart(2, '0');
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Parse a cell ID string back to row/column coordinates
|
|
64
|
+
* @param cellId - Cell ID string (e.g., "A1", "A01", "AB15")
|
|
65
|
+
* @returns Row and column indices (0-based) or undefined if invalid
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export function parseCellId(cellId) {
|
|
69
|
+
const match = cellId.match(/^([A-Z]{1,2})([0-9]{1,3})$/);
|
|
70
|
+
/* c8 ignore next 3 - functional code tested but coverage intermittently missed */
|
|
71
|
+
if (!match) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
const rowLetters = match[1];
|
|
75
|
+
const colNumber = parseInt(match[2], 10);
|
|
76
|
+
let row;
|
|
77
|
+
if (rowLetters.length === 1) {
|
|
78
|
+
// Single letter: A-Z maps to rows 0-25
|
|
79
|
+
row = rowLetters.charCodeAt(0) - firstRowIdChar;
|
|
80
|
+
/* c8 ignore next 6 - functional code tested but coverage intermittently missed */
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
// Double letters: AA-ZZ for rows 26+
|
|
84
|
+
const firstLetter = rowLetters.charCodeAt(0) - firstRowIdChar;
|
|
85
|
+
const secondLetter = rowLetters.charCodeAt(1) - firstRowIdChar;
|
|
86
|
+
row = (firstLetter + 1) * 26 + secondLetter;
|
|
87
|
+
}
|
|
88
|
+
const col = colNumber - 1; // Convert from 1-based to 0-based
|
|
89
|
+
return { row, col };
|
|
90
|
+
}
|
|
91
|
+
function isRowColumn(from) {
|
|
92
|
+
return typeof from === 'object' && from !== null && 'row' in from && `col` in from;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
export class Ids {
|
|
98
|
+
static cageId(from) {
|
|
99
|
+
if (typeof from === 'string') {
|
|
100
|
+
return Converters.cageId.convert(from);
|
|
101
|
+
}
|
|
102
|
+
/* c8 ignore next 2 - functional code tested but coverage intermittently missed */
|
|
103
|
+
return succeed(from.id);
|
|
104
|
+
}
|
|
105
|
+
static cellId(spec) {
|
|
106
|
+
if (isRowColumn(spec)) {
|
|
107
|
+
if ('id' in spec) {
|
|
108
|
+
return succeed(spec.id);
|
|
109
|
+
}
|
|
110
|
+
// Standard sudoku convention: Letters for rows (A-I), numbers for columns (1-9)
|
|
111
|
+
const rowLetter = columnToLetters(spec.row);
|
|
112
|
+
// For 9x9 grids, use single digit format for backward compatibility
|
|
113
|
+
// For larger grids, use zero-padding
|
|
114
|
+
const colNumber = spec.col < 9 ? (spec.col + 1).toString() : rowToNumber(spec.col);
|
|
115
|
+
return succeed(`${rowLetter}${colNumber}`);
|
|
116
|
+
}
|
|
117
|
+
return Converters.cellId.convert(spec);
|
|
118
|
+
}
|
|
119
|
+
static rowCageId(row) {
|
|
120
|
+
return `R${columnToLetters(row)}`;
|
|
121
|
+
}
|
|
122
|
+
static columnCageId(col) {
|
|
123
|
+
// For backward compatibility, use single digit for columns < 9
|
|
124
|
+
const colNumber = col < 9 ? (col + 1).toString() : rowToNumber(col);
|
|
125
|
+
return `C${colNumber}`;
|
|
126
|
+
}
|
|
127
|
+
static sectionCageId(row, col, cageHeight = 3, cageWidth = 3) {
|
|
128
|
+
row = Math.floor(row / cageHeight) * cageHeight;
|
|
129
|
+
col = Math.floor(col / cageWidth) * cageWidth;
|
|
130
|
+
// Section IDs use row letter and column number
|
|
131
|
+
const rowLetter = columnToLetters(row);
|
|
132
|
+
const colNumber = col < 9 ? (col + 1).toString() : rowToNumber(col);
|
|
133
|
+
return `S${rowLetter}${colNumber}`;
|
|
134
|
+
}
|
|
135
|
+
static cellIds(firstRow, numRows, firstCol, numCols) {
|
|
136
|
+
const cellIds = [];
|
|
137
|
+
for (let row = firstRow; row < firstRow + numRows; row++) {
|
|
138
|
+
for (let col = firstCol; col < firstCol + numCols; col++) {
|
|
139
|
+
const result = this.cellId({ row, col }).onSuccess((id) => {
|
|
140
|
+
cellIds.push(id);
|
|
141
|
+
return succeed(id);
|
|
142
|
+
});
|
|
143
|
+
/* c8 ignore next 3 - defense in depth should not happen */
|
|
144
|
+
if (result.isFailure()) {
|
|
145
|
+
return fail(result.message);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return succeed(cellIds);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=ids.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2023 Erik Fortune
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import * as Converters from './converters';
|
|
25
|
+
export * from './cage';
|
|
26
|
+
export * from './cell';
|
|
27
|
+
export * from './common';
|
|
28
|
+
export { Ids, parseCellId } from './ids';
|
|
29
|
+
export { DefaultSudokuLogger } from './logging';
|
|
30
|
+
export * from './public';
|
|
31
|
+
export * from './puzzle';
|
|
32
|
+
export * from './puzzleDefinitions';
|
|
33
|
+
export * from './puzzleSession';
|
|
34
|
+
export * from './puzzleState';
|
|
35
|
+
export { Converters };
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2023 Erik Fortune
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import { Logging } from '@fgv/ts-utils';
|
|
25
|
+
/**
|
|
26
|
+
* Default no-op logger for use when diagnostic logging is not needed.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export const DefaultSudokuLogger = new Logging.LogReporter({
|
|
30
|
+
logger: new Logging.NoOpLogger()
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=logging.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2023 Erik Fortune
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=public.js.map
|