@fgv/ts-sudoku-lib 2.0.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -0
  3. package/cspell.json +13 -0
  4. package/dist/ts-sudoku-lib.d.ts +763 -0
  5. package/dist/tsdoc-metadata.json +11 -0
  6. package/lib/index.d.ts +6 -0
  7. package/lib/index.d.ts.map +1 -0
  8. package/lib/index.js +59 -0
  9. package/lib/index.js.map +1 -0
  10. package/lib/packlets/collections/collections.d.ts +55 -0
  11. package/lib/packlets/collections/collections.d.ts.map +1 -0
  12. package/lib/packlets/collections/collections.js +137 -0
  13. package/lib/packlets/collections/collections.js.map +1 -0
  14. package/lib/packlets/collections/data/puzzles.json +61 -0
  15. package/lib/packlets/collections/index.d.ts +2 -0
  16. package/lib/packlets/collections/index.d.ts.map +1 -0
  17. package/lib/packlets/collections/index.js +41 -0
  18. package/lib/packlets/collections/index.js.map +1 -0
  19. package/lib/packlets/common/cage.d.ts +23 -0
  20. package/lib/packlets/common/cage.d.ts.map +1 -0
  21. package/lib/packlets/common/cage.js +87 -0
  22. package/lib/packlets/common/cage.js.map +1 -0
  23. package/lib/packlets/common/cell.d.ts +34 -0
  24. package/lib/packlets/common/cell.d.ts.map +1 -0
  25. package/lib/packlets/common/cell.js +92 -0
  26. package/lib/packlets/common/cell.js.map +1 -0
  27. package/lib/packlets/common/common.d.ts +77 -0
  28. package/lib/packlets/common/common.d.ts.map +1 -0
  29. package/lib/packlets/common/common.js +49 -0
  30. package/lib/packlets/common/common.js.map +1 -0
  31. package/lib/packlets/common/converters.d.ts +24 -0
  32. package/lib/packlets/common/converters.d.ts.map +1 -0
  33. package/lib/packlets/common/converters.js +73 -0
  34. package/lib/packlets/common/converters.js.map +1 -0
  35. package/lib/packlets/common/ids.d.ts +15 -0
  36. package/lib/packlets/common/ids.d.ts.map +1 -0
  37. package/lib/packlets/common/ids.js +107 -0
  38. package/lib/packlets/common/ids.js.map +1 -0
  39. package/lib/packlets/common/index.d.ts +12 -0
  40. package/lib/packlets/common/index.d.ts.map +1 -0
  41. package/lib/packlets/common/index.js +65 -0
  42. package/lib/packlets/common/index.js.map +1 -0
  43. package/lib/packlets/common/model.d.ts +15 -0
  44. package/lib/packlets/common/model.d.ts.map +1 -0
  45. package/lib/packlets/common/model.js +26 -0
  46. package/lib/packlets/common/model.js.map +1 -0
  47. package/lib/packlets/common/public.d.ts +65 -0
  48. package/lib/packlets/common/public.d.ts.map +1 -0
  49. package/lib/packlets/common/public.js +26 -0
  50. package/lib/packlets/common/public.js.map +1 -0
  51. package/lib/packlets/common/puzzle.d.ts +99 -0
  52. package/lib/packlets/common/puzzle.d.ts.map +1 -0
  53. package/lib/packlets/common/puzzle.js +389 -0
  54. package/lib/packlets/common/puzzle.js.map +1 -0
  55. package/lib/packlets/common/puzzleSession.d.ts +214 -0
  56. package/lib/packlets/common/puzzleSession.d.ts.map +1 -0
  57. package/lib/packlets/common/puzzleSession.js +361 -0
  58. package/lib/packlets/common/puzzleSession.js.map +1 -0
  59. package/lib/packlets/common/puzzleState.d.ts +52 -0
  60. package/lib/packlets/common/puzzleState.d.ts.map +1 -0
  61. package/lib/packlets/common/puzzleState.js +100 -0
  62. package/lib/packlets/common/puzzleState.js.map +1 -0
  63. package/lib/packlets/file/converters.d.ts +17 -0
  64. package/lib/packlets/file/converters.d.ts.map +1 -0
  65. package/lib/packlets/file/converters.js +49 -0
  66. package/lib/packlets/file/converters.js.map +1 -0
  67. package/lib/packlets/file/index.d.ts +4 -0
  68. package/lib/packlets/file/index.d.ts.map +1 -0
  69. package/lib/packlets/file/index.js +54 -0
  70. package/lib/packlets/file/index.js.map +1 -0
  71. package/lib/packlets/file/model.d.ts +9 -0
  72. package/lib/packlets/file/model.d.ts.map +1 -0
  73. package/lib/packlets/file/model.js +26 -0
  74. package/lib/packlets/file/model.js.map +1 -0
  75. package/lib/packlets/puzzles/anyPuzzle.d.ts +10 -0
  76. package/lib/packlets/puzzles/anyPuzzle.d.ts.map +1 -0
  77. package/lib/packlets/puzzles/anyPuzzle.js +51 -0
  78. package/lib/packlets/puzzles/anyPuzzle.js.map +1 -0
  79. package/lib/packlets/puzzles/index.d.ts +6 -0
  80. package/lib/packlets/puzzles/index.d.ts.map +1 -0
  81. package/lib/packlets/puzzles/index.js +35 -0
  82. package/lib/packlets/puzzles/index.js.map +1 -0
  83. package/lib/packlets/puzzles/killerSudokuPuzzle.d.ts +14 -0
  84. package/lib/packlets/puzzles/killerSudokuPuzzle.d.ts.map +1 -0
  85. package/lib/packlets/puzzles/killerSudokuPuzzle.js +136 -0
  86. package/lib/packlets/puzzles/killerSudokuPuzzle.js.map +1 -0
  87. package/lib/packlets/puzzles/sudokuPuzzle.d.ts +10 -0
  88. package/lib/packlets/puzzles/sudokuPuzzle.d.ts.map +1 -0
  89. package/lib/packlets/puzzles/sudokuPuzzle.js +47 -0
  90. package/lib/packlets/puzzles/sudokuPuzzle.js.map +1 -0
  91. package/lib/packlets/puzzles/sudokuXPuzzle.d.ts +11 -0
  92. package/lib/packlets/puzzles/sudokuXPuzzle.d.ts.map +1 -0
  93. package/lib/packlets/puzzles/sudokuXPuzzle.js +65 -0
  94. package/lib/packlets/puzzles/sudokuXPuzzle.js.map +1 -0
  95. package/package.json +70 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ /*
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2023 Erik Fortune
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Cell = void 0;
27
+ const ts_utils_1 = require("@fgv/ts-utils");
28
+ /**
29
+ * @internal
30
+ */
31
+ class Cell {
32
+ constructor(init, cages) {
33
+ this.id = init.id;
34
+ this.row = init.row;
35
+ this.col = init.col;
36
+ this.cages = [...cages];
37
+ this.immutableValue = init.immutableValue;
38
+ this.immutable = init.immutableValue !== undefined;
39
+ }
40
+ isValid(state) {
41
+ if (this.immutable) {
42
+ return true;
43
+ }
44
+ const cell = state.getCellContents(this.id).orDefault();
45
+ return cell !== undefined && this.isValidValue(cell.value, state);
46
+ }
47
+ hasValue(state) {
48
+ if (this.immutable) {
49
+ return true;
50
+ }
51
+ const cell = state.getCellContents(this.id).orDefault();
52
+ /* c8 ignore next - defense in depth ? should never happen */
53
+ return (cell === null || cell === void 0 ? void 0 : cell.value) !== undefined;
54
+ }
55
+ isValidValue(value, state) {
56
+ if (this.immutable) {
57
+ return false;
58
+ }
59
+ else if (value === undefined) {
60
+ return true;
61
+ }
62
+ return !this.cages.find((cage) => cage.containsValue(value, state, [this.id]));
63
+ }
64
+ update(value, notes) {
65
+ if (this.immutable) {
66
+ return (0, ts_utils_1.fail)(`cannot set value "${value}" in immutable cell ${this.id}`);
67
+ }
68
+ return (0, ts_utils_1.succeed)({
69
+ id: this.id,
70
+ value,
71
+ notes
72
+ });
73
+ }
74
+ updateValue(value, state) {
75
+ return state.getCellContents(this.id).onSuccess((contents) => {
76
+ return this.update(value, contents.notes);
77
+ });
78
+ }
79
+ updateNotes(notes, state) {
80
+ return state.getCellContents(this.id).onSuccess((contents) => {
81
+ return this.update(contents.value, notes);
82
+ });
83
+ }
84
+ toString(state) {
85
+ var _a;
86
+ const contents = state === null || state === void 0 ? void 0 : state.getCellContents(this.id).orDefault();
87
+ const value = (_a = this.immutableValue) !== null && _a !== void 0 ? _a : contents === null || contents === void 0 ? void 0 : contents.value;
88
+ return value && value >= 1 && value <= 9 ? String(value) : '.';
89
+ }
90
+ }
91
+ exports.Cell = Cell;
92
+ //# sourceMappingURL=cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell.js","sourceRoot":"","sources":["../../../src/packlets/common/cell.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAEH,4CAAsD;AAgBtD;;GAEG;AACH,MAAa,IAAI;IASf,YAAmB,IAAe,EAAE,KAAsB;QACxD,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC;IACrD,CAAC;IAEM,OAAO,CAAC,KAAkB;QAC/B,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;QACxD,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;IAEM,QAAQ,CAAC,KAAkB;QAChC,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;QACxD,6DAA6D;QAC7D,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,MAAK,SAAS,CAAC;IACnC,CAAC;IAEM,YAAY,CAAC,KAAyB,EAAE,KAAkB;QAC/D,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,KAAK,CAAC;SACd;aAAM,IAAI,KAAK,KAAK,SAAS,EAAE;YAC9B,OAAO,IAAI,CAAC;SACb;QACD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjF,CAAC;IAEM,MAAM,CAAC,KAAyB,EAAE,KAAe;QACtD,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,IAAA,eAAI,EAAC,qBAAqB,KAAK,uBAAuB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;SACzE;QACD,OAAO,IAAA,kBAAO,EAAC;YACb,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK;YACL,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAEM,WAAW,CAAC,KAAyB,EAAE,KAAkB;QAC9D,OAAO,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,QAAuB,EAAE,EAAE;YAC1E,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,WAAW,CAAC,KAAe,EAAE,KAAkB;QACpD,OAAO,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,QAAuB,EAAE,EAAE;YAC1E,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,QAAQ,CAAC,KAAmB;;QACjC,MAAM,QAAQ,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC;QAC7D,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,cAAc,mCAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC;QACrD,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACjE,CAAC;CACF;AAxED,oBAwEC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, fail, succeed } from '@fgv/ts-utils';\nimport { Cage } from './cage';\nimport { CellId, ICellContents, ICellState } from './common';\nimport { ICell } from './public';\nimport { PuzzleState } from './puzzleState';\n\n/**\n * @internal\n */\nexport interface ICellInit {\n readonly id: CellId;\n readonly row: number;\n readonly col: number;\n readonly immutableValue?: number;\n}\n\n/**\n * @internal\n */\nexport class Cell implements ICellInit, ICell {\n public readonly id: CellId;\n public readonly row: number;\n public readonly col: number;\n public readonly cages: readonly Cage[];\n\n public readonly immutable: boolean;\n public readonly immutableValue?: number;\n\n public constructor(init: ICellInit, cages: readonly Cage[]) {\n this.id = init.id;\n this.row = init.row;\n this.col = init.col;\n this.cages = [...cages];\n this.immutableValue = init.immutableValue;\n this.immutable = init.immutableValue !== undefined;\n }\n\n public isValid(state: PuzzleState): boolean {\n if (this.immutable) {\n return true;\n }\n const cell = state.getCellContents(this.id).orDefault();\n return cell !== undefined && this.isValidValue(cell.value, state);\n }\n\n public hasValue(state: PuzzleState): boolean {\n if (this.immutable) {\n return true;\n }\n const cell = state.getCellContents(this.id).orDefault();\n /* c8 ignore next - defense in depth ? should never happen */\n return cell?.value !== undefined;\n }\n\n public isValidValue(value: number | undefined, state: PuzzleState): boolean {\n if (this.immutable) {\n return false;\n } else if (value === undefined) {\n return true;\n }\n return !this.cages.find((cage) => cage.containsValue(value, state, [this.id]));\n }\n\n public update(value: number | undefined, notes: number[]): Result<ICellState> {\n if (this.immutable) {\n return fail(`cannot set value \"${value}\" in immutable cell ${this.id}`);\n }\n return succeed({\n id: this.id,\n value,\n notes\n });\n }\n\n public updateValue(value: number | undefined, state: PuzzleState): Result<ICellState> {\n return state.getCellContents(this.id).onSuccess((contents: ICellContents) => {\n return this.update(value, contents.notes);\n });\n }\n\n public updateNotes(notes: number[], state: PuzzleState): Result<ICellState> {\n return state.getCellContents(this.id).onSuccess((contents: ICellContents) => {\n return this.update(contents.value, notes);\n });\n }\n\n public toString(state?: PuzzleState): string {\n const contents = state?.getCellContents(this.id).orDefault();\n const value = this.immutableValue ?? contents?.value;\n return value && value >= 1 && value <= 9 ? String(value) : '.';\n }\n}\n"]}
@@ -0,0 +1,77 @@
1
+ import { Brand } from '@fgv/ts-utils';
2
+ /**
3
+ * Nominal identifier for a single {@Link ICell | cell} in a {@link PuzzleSession | puzzle}.
4
+ * @public
5
+ */
6
+ export type CellId = Brand<string, 'CellId'>;
7
+ /**
8
+ * Nominal identifier for a single {@Link ICage | cage} in a {@link PuzzleSession | puzzle}.
9
+ * @public
10
+ */
11
+ export type CageId = Brand<string, 'CageId'>;
12
+ /**
13
+ * Identifies the type of a {@Link ICage | cage}.
14
+ * @public
15
+ */
16
+ export type CageType = 'row' | 'column' | 'section' | 'x' | 'killer';
17
+ /**
18
+ * The row/column coordinate of a single {@Link ICell | cell} in a {@link PuzzleSession | puzzle}.
19
+ * @public
20
+ */
21
+ export interface IRowColumn {
22
+ row: number;
23
+ col: number;
24
+ }
25
+ /**
26
+ * The contents of a single {@Link ICell | cell} in a {@link PuzzleSession | puzzle}.
27
+ * @public
28
+ */
29
+ export interface ICellContents {
30
+ /**
31
+ * The value of the {@link ICell | cell}, or `undefined` if no value has been assigned.
32
+ */
33
+ readonly value?: number;
34
+ /**
35
+ * Any notes associated with the {@link ICell | cell}.
36
+ */
37
+ readonly notes: number[];
38
+ }
39
+ /**
40
+ * Describes the state of or a state update for a single {@link ICell |cell} in a
41
+ * {@link PuzzleSession | puzzle}.
42
+ * @public
43
+ */
44
+ export interface ICellState extends ICellContents {
45
+ readonly id: CellId;
46
+ }
47
+ /**
48
+ * Describes the rules that apply to the puzzle.
49
+ * @public
50
+ */
51
+ export type PuzzleType = 'killer-sudoku' | 'sudoku' | 'sudoku-x';
52
+ /**
53
+ * All supported public types.
54
+ * @public
55
+ */
56
+ export declare const allPuzzleTypes: PuzzleType[];
57
+ /**
58
+ * The minimum and maximum possible values for a {@link ICage | cage}, by cage size in
59
+ * {@link ICell | cells}.
60
+ * @public
61
+ */
62
+ export declare const totalsByCageSize: readonly {
63
+ min: number;
64
+ max: number;
65
+ }[];
66
+ /**
67
+ * Navigation direction within a puzzle.
68
+ * @public
69
+ *
70
+ */
71
+ export type NavigationDirection = 'down' | 'left' | 'right' | 'up';
72
+ /**
73
+ * Wrapping rules when navigating within a puzzle.
74
+ * @public
75
+ */
76
+ export type NavigationWrap = 'none' | 'wrap-around' | 'wrap-next';
77
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/common.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,GAAG,GAAG,QAAQ,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AAEH,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC/C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,UAAU,EAA4C,CAAC;AAEpF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAWnE,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /*
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2023 Erik Fortune
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.totalsByCageSize = exports.allPuzzleTypes = void 0;
27
+ /**
28
+ * All supported public types.
29
+ * @public
30
+ */
31
+ exports.allPuzzleTypes = ['killer-sudoku', 'sudoku', 'sudoku-x'];
32
+ /**
33
+ * The minimum and maximum possible values for a {@link ICage | cage}, by cage size in
34
+ * {@link ICell | cells}.
35
+ * @public
36
+ */
37
+ exports.totalsByCageSize = [
38
+ { min: 0, max: 0 },
39
+ { min: 1, max: 9 },
40
+ { min: 3, max: 17 },
41
+ { min: 6, max: 24 },
42
+ { min: 10, max: 30 },
43
+ { min: 15, max: 35 },
44
+ { min: 21, max: 39 },
45
+ { min: 28, max: 42 },
46
+ { min: 36, max: 44 },
47
+ { min: 45, max: 45 }
48
+ ];
49
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/packlets/common/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AA8DH;;;GAGG;AACU,QAAA,cAAc,GAAiB,CAAC,eAAe,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAEpF;;;;GAIG;AACU,QAAA,gBAAgB,GAA4C;IACvE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;IAClB,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;IAClB,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IACnB,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IACnB,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IACpB,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IACpB,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IACpB,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IACpB,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IACpB,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;CACrB,CAAC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Brand } from '@fgv/ts-utils';\n\n/**\n * Nominal identifier for a single {@Link ICell | cell} in a {@link PuzzleSession | puzzle}.\n * @public\n */\nexport type CellId = Brand<string, 'CellId'>;\n\n/**\n * Nominal identifier for a single {@Link ICage | cage} in a {@link PuzzleSession | puzzle}.\n * @public\n */\nexport type CageId = Brand<string, 'CageId'>;\n\n/**\n * Identifies the type of a {@Link ICage | cage}.\n * @public\n */\nexport type CageType = 'row' | 'column' | 'section' | 'x' | 'killer';\n\n/**\n * The row/column coordinate of a single {@Link ICell | cell} in a {@link PuzzleSession | puzzle}.\n * @public\n */\nexport interface IRowColumn {\n row: number;\n col: number;\n}\n\n/**\n * The contents of a single {@Link ICell | cell} in a {@link PuzzleSession | puzzle}.\n * @public\n */\nexport interface ICellContents {\n /**\n * The value of the {@link ICell | cell}, or `undefined` if no value has been assigned.\n */\n readonly value?: number;\n /**\n * Any notes associated with the {@link ICell | cell}.\n */\n readonly notes: number[];\n}\n\n/**\n * Describes the state of or a state update for a single {@link ICell |cell} in a\n * {@link PuzzleSession | puzzle}.\n * @public\n */\n\nexport interface ICellState extends ICellContents {\n readonly id: CellId;\n}\n\n/**\n * Describes the rules that apply to the puzzle.\n * @public\n */\nexport type PuzzleType = 'killer-sudoku' | 'sudoku' | 'sudoku-x';\n\n/**\n * All supported public types.\n * @public\n */\nexport const allPuzzleTypes: PuzzleType[] = ['killer-sudoku', 'sudoku', 'sudoku-x'];\n\n/**\n * The minimum and maximum possible values for a {@link ICage | cage}, by cage size in\n * {@link ICell | cells}.\n * @public\n */\nexport const totalsByCageSize: readonly { min: number; max: number }[] = [\n { min: 0, max: 0 },\n { min: 1, max: 9 },\n { min: 3, max: 17 },\n { min: 6, max: 24 },\n { min: 10, max: 30 },\n { min: 15, max: 35 },\n { min: 21, max: 39 },\n { min: 28, max: 42 },\n { min: 36, max: 44 },\n { min: 45, max: 45 }\n];\n\n/**\n * Navigation direction within a puzzle.\n * @public\n *\n */\nexport type NavigationDirection = 'down' | 'left' | 'right' | 'up';\n\n/**\n * Wrapping rules when navigating within a puzzle.\n * @public\n */\nexport type NavigationWrap = 'none' | 'wrap-around' | 'wrap-next';\n"]}
@@ -0,0 +1,24 @@
1
+ import { Converter } from '@fgv/ts-utils';
2
+ import { CageId, CellId, PuzzleType } from './common';
3
+ import { IPuzzleDescription } from './model';
4
+ /**
5
+ * Converts an arbitrary value to a {@link CageId | CageId}.
6
+ * @public
7
+ */
8
+ export declare const cageId: Converter<CageId>;
9
+ /**
10
+ * Converts an arbitrary value to a {@link CellId | CellId}.
11
+ * @public
12
+ */
13
+ export declare const cellId: Converter<CellId>;
14
+ /**
15
+ * Converts an arbitrary value to a {@link PuzzleType | PuzzleType}.
16
+ * @public
17
+ */
18
+ export declare const puzzleType: Converter<PuzzleType, PuzzleType[]>;
19
+ /**
20
+ * Converts an arbitrary object to a {@link Data.Model.PuzzleDescription | PuzzleDescription}.
21
+ * @public
22
+ */
23
+ export declare const puzzleDescription: Converter<IPuzzleDescription>;
24
+ //# sourceMappingURL=converters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/converters.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAqC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAkB,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAmB7C;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,MAAM,CAAyC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,MAAM,CAAyC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,CACH,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,kBAAkB,CAa3D,CAAC"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /*
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2023 Erik Fortune
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.puzzleDescription = exports.puzzleType = exports.cellId = exports.cageId = void 0;
27
+ const ts_utils_1 = require("@fgv/ts-utils");
28
+ const common_1 = require("./common");
29
+ const cageIdRegExp = /^(R[A-Z]$)|(C[0-9]$)|(S[A-Z][0-9]$)|(X[1-2]$)|(K[A-Za-z]$)/;
30
+ function validateCageId(from) {
31
+ if (cageIdRegExp.test(from)) {
32
+ return (0, ts_utils_1.succeed)(from);
33
+ }
34
+ return (0, ts_utils_1.fail)(`malformed cage ID "${from}" (expected "R[A-Z]", "C[0-9]" or "S[A-Z][0-9]")`);
35
+ }
36
+ const cellIdRegExp = /^[A-Z][0-9]$/;
37
+ function validateCellId(from) {
38
+ if (cellIdRegExp.test(from)) {
39
+ return (0, ts_utils_1.succeed)(from);
40
+ }
41
+ return (0, ts_utils_1.fail)(`malformed cell ID "${from}" (expected "[A-Z][0-9]")`);
42
+ }
43
+ /**
44
+ * Converts an arbitrary value to a {@link CageId | CageId}.
45
+ * @public
46
+ */
47
+ exports.cageId = ts_utils_1.Converters.string.map(validateCageId);
48
+ /**
49
+ * Converts an arbitrary value to a {@link CellId | CellId}.
50
+ * @public
51
+ */
52
+ exports.cellId = ts_utils_1.Converters.string.map(validateCellId);
53
+ /**
54
+ * Converts an arbitrary value to a {@link PuzzleType | PuzzleType}.
55
+ * @public
56
+ */
57
+ exports.puzzleType = ts_utils_1.Converters.enumeratedValue(common_1.allPuzzleTypes);
58
+ /**
59
+ * Converts an arbitrary object to a {@link Data.Model.PuzzleDescription | PuzzleDescription}.
60
+ * @public
61
+ */
62
+ exports.puzzleDescription = ts_utils_1.Converters.strictObject({
63
+ id: ts_utils_1.Converters.string,
64
+ description: ts_utils_1.Converters.string,
65
+ type: exports.puzzleType,
66
+ level: ts_utils_1.Converters.number,
67
+ rows: ts_utils_1.Converters.number,
68
+ cols: ts_utils_1.Converters.number,
69
+ cells: ts_utils_1.Converters.oneOf([ts_utils_1.Converters.string, ts_utils_1.Converters.stringArray.map((s) => (0, ts_utils_1.succeed)(s.join('')))])
70
+ }, {
71
+ optionalFields: ['id']
72
+ });
73
+ //# sourceMappingURL=converters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converters.js","sourceRoot":"","sources":["../../../src/packlets/common/converters.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAEH,4CAA6E;AAC7E,qCAAsE;AAGtE,MAAM,YAAY,GAAW,4DAA4D,CAAC;AAE1F,SAAS,cAAc,CAAC,IAAY;IAClC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC3B,OAAO,IAAA,kBAAO,EAAC,IAAc,CAAC,CAAC;KAChC;IACD,OAAO,IAAA,eAAI,EAAC,sBAAsB,IAAI,kDAAkD,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,YAAY,GAAW,cAAc,CAAC;AAC5C,SAAS,cAAc,CAAC,IAAY;IAClC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC3B,OAAO,IAAA,kBAAO,EAAC,IAAc,CAAC,CAAC;KAChC;IACD,OAAO,IAAA,eAAI,EAAC,sBAAsB,IAAI,2BAA2B,CAAC,CAAC;AACrE,CAAC;AAED;;;GAGG;AACU,QAAA,MAAM,GAAsB,qBAAU,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAE/E;;;GAGG;AACU,QAAA,MAAM,GAAsB,qBAAU,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAE/E;;;GAGG;AACU,QAAA,UAAU,GACrB,qBAAU,CAAC,eAAe,CAAa,uBAAc,CAAC,CAAC;AAEzD;;;GAGG;AACU,QAAA,iBAAiB,GAAkC,qBAAU,CAAC,YAAY,CACrF;IACE,EAAE,EAAE,qBAAU,CAAC,MAAM;IACrB,WAAW,EAAE,qBAAU,CAAC,MAAM;IAC9B,IAAI,EAAE,kBAAU;IAChB,KAAK,EAAE,qBAAU,CAAC,MAAM;IACxB,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,KAAK,EAAE,qBAAU,CAAC,KAAK,CAAC,CAAC,qBAAU,CAAC,MAAM,EAAE,qBAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,kBAAO,EAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CACrG,EACD;IACE,cAAc,EAAE,CAAC,IAAI,CAAC;CACvB,CACF,CAAC","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, Result, fail, succeed } from '@fgv/ts-utils';\nimport { CageId, CellId, PuzzleType, allPuzzleTypes } from './common';\nimport { IPuzzleDescription } from './model';\n\nconst cageIdRegExp: RegExp = /^(R[A-Z]$)|(C[0-9]$)|(S[A-Z][0-9]$)|(X[1-2]$)|(K[A-Za-z]$)/;\n\nfunction validateCageId(from: string): Result<CageId> {\n if (cageIdRegExp.test(from)) {\n return succeed(from as CageId);\n }\n return fail(`malformed cage ID \"${from}\" (expected \"R[A-Z]\", \"C[0-9]\" or \"S[A-Z][0-9]\")`);\n}\n\nconst cellIdRegExp: RegExp = /^[A-Z][0-9]$/;\nfunction validateCellId(from: string): Result<CellId> {\n if (cellIdRegExp.test(from)) {\n return succeed(from as CellId);\n }\n return fail(`malformed cell ID \"${from}\" (expected \"[A-Z][0-9]\")`);\n}\n\n/**\n * Converts an arbitrary value to a {@link CageId | CageId}.\n * @public\n */\nexport const cageId: Converter<CageId> = Converters.string.map(validateCageId);\n\n/**\n * Converts an arbitrary value to a {@link CellId | CellId}.\n * @public\n */\nexport const cellId: Converter<CellId> = Converters.string.map(validateCellId);\n\n/**\n * Converts an arbitrary value to a {@link PuzzleType | PuzzleType}.\n * @public\n */\nexport const puzzleType: Converter<PuzzleType, PuzzleType[]> =\n Converters.enumeratedValue<PuzzleType>(allPuzzleTypes);\n\n/**\n * Converts an arbitrary object to a {@link Data.Model.PuzzleDescription | PuzzleDescription}.\n * @public\n */\nexport const puzzleDescription: Converter<IPuzzleDescription> = Converters.strictObject<IPuzzleDescription>(\n {\n id: Converters.string,\n description: Converters.string,\n type: puzzleType,\n level: Converters.number,\n rows: Converters.number,\n cols: Converters.number,\n cells: Converters.oneOf([Converters.string, Converters.stringArray.map((s) => succeed(s.join('')))])\n },\n {\n optionalFields: ['id']\n }\n);\n"]}
@@ -0,0 +1,15 @@
1
+ import { Result } from '@fgv/ts-utils';
2
+ import { CageId, CellId, IRowColumn } from './common';
3
+ import { ICage, ICell } from './public';
4
+ /**
5
+ * @public
6
+ */
7
+ export declare class Ids {
8
+ static cageId(from: string | ICage): Result<CageId>;
9
+ static cellId(spec: string | IRowColumn | ICell): Result<CellId>;
10
+ static rowCageId(row: number): CageId;
11
+ static columnCageId(col: number): CageId;
12
+ static sectionCageId(row: number, col: number): CageId;
13
+ static cellIds(firstRow: number, numRows: number, firstCol: number, numCols: number): Result<CellId[]>;
14
+ }
15
+ //# sourceMappingURL=ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/ids.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AASxC;;GAEG;AACH,qBAAa,GAAG;WACA,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;WAO5C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;WAYzD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;WAI9B,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;WAIjC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;WAQ/C,OAAO,CACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,CAAC;CAiBpB"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ /*
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2023 Erik Fortune
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ var desc = Object.getOwnPropertyDescriptor(m, k);
28
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
29
+ desc = { enumerable: true, get: function() { return m[k]; } };
30
+ }
31
+ Object.defineProperty(o, k2, desc);
32
+ }) : (function(o, m, k, k2) {
33
+ if (k2 === undefined) k2 = k;
34
+ o[k2] = m[k];
35
+ }));
36
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
37
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
38
+ }) : function(o, v) {
39
+ o["default"] = v;
40
+ });
41
+ var __importStar = (this && this.__importStar) || function (mod) {
42
+ if (mod && mod.__esModule) return mod;
43
+ var result = {};
44
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
45
+ __setModuleDefault(result, mod);
46
+ return result;
47
+ };
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.Ids = void 0;
50
+ const ts_utils_1 = require("@fgv/ts-utils");
51
+ const Converters = __importStar(require("./converters"));
52
+ const firstRowIdChar = 'A'.charCodeAt(0);
53
+ const firstColIdChar = '1'.charCodeAt(0);
54
+ function isRowColumn(from) {
55
+ return typeof from === 'object' && from !== null && 'row' in from && `col` in from;
56
+ }
57
+ /**
58
+ * @public
59
+ */
60
+ class Ids {
61
+ static cageId(from) {
62
+ if (typeof from === 'string') {
63
+ return Converters.cageId.convert(from);
64
+ }
65
+ return (0, ts_utils_1.succeed)(from.id);
66
+ }
67
+ static cellId(spec) {
68
+ if (isRowColumn(spec)) {
69
+ if ('id' in spec) {
70
+ return (0, ts_utils_1.succeed)(spec.id);
71
+ }
72
+ const row = String.fromCharCode(firstRowIdChar + spec.row);
73
+ const col = String.fromCharCode(firstColIdChar + spec.col);
74
+ return (0, ts_utils_1.succeed)(`${row}${col}`);
75
+ }
76
+ return Converters.cellId.convert(spec);
77
+ }
78
+ static rowCageId(row) {
79
+ return `R${String.fromCharCode(firstRowIdChar + row)}`;
80
+ }
81
+ static columnCageId(col) {
82
+ return `C${String.fromCharCode(firstColIdChar + col)}`;
83
+ }
84
+ static sectionCageId(row, col) {
85
+ row = Math.floor(row / 3) * 3;
86
+ col = Math.floor(col / 3) * 3;
87
+ return `S${String.fromCharCode(firstRowIdChar + row)}${String.fromCharCode(firstColIdChar + col)}`;
88
+ }
89
+ static cellIds(firstRow, numRows, firstCol, numCols) {
90
+ const cellIds = [];
91
+ for (let row = firstRow; row < firstRow + numRows; row++) {
92
+ for (let col = firstCol; col < firstCol + numCols; col++) {
93
+ const result = this.cellId({ row, col }).onSuccess((id) => {
94
+ cellIds.push(id);
95
+ return (0, ts_utils_1.succeed)(id);
96
+ });
97
+ /* c8 ignore next 3 - defense in depth should not happen */
98
+ if (result.isFailure()) {
99
+ return (0, ts_utils_1.fail)(result.message);
100
+ }
101
+ }
102
+ }
103
+ return (0, ts_utils_1.succeed)(cellIds);
104
+ }
105
+ }
106
+ exports.Ids = Ids;
107
+ //# sourceMappingURL=ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../src/packlets/common/ids.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, fail, succeed } from '@fgv/ts-utils';\nimport { CageId, CellId, IRowColumn } from './common';\nimport * as Converters from './converters';\nimport { ICage, ICell } from './public';\n\nconst firstRowIdChar: number = 'A'.charCodeAt(0);\nconst firstColIdChar: number = '1'.charCodeAt(0);\n\nfunction isRowColumn(from: unknown): from is IRowColumn {\n return typeof from === 'object' && from !== null && 'row' in from && `col` in from;\n}\n\n/**\n * @public\n */\nexport class Ids {\n public static cageId(from: string | ICage): Result<CageId> {\n if (typeof from === 'string') {\n return Converters.cageId.convert(from);\n }\n return succeed(from.id);\n }\n\n public static cellId(spec: string | IRowColumn | ICell): Result<CellId> {\n if (isRowColumn(spec)) {\n if ('id' in spec) {\n return succeed(spec.id);\n }\n const row = String.fromCharCode(firstRowIdChar + spec.row);\n const col = String.fromCharCode(firstColIdChar + spec.col);\n return succeed(`${row}${col}` as CellId);\n }\n return Converters.cellId.convert(spec);\n }\n\n public static rowCageId(row: number): CageId {\n return `R${String.fromCharCode(firstRowIdChar + row)}` as CageId;\n }\n\n public static columnCageId(col: number): CageId {\n return `C${String.fromCharCode(firstColIdChar + col)}` as CageId;\n }\n\n public static sectionCageId(row: number, col: number): CageId {\n row = Math.floor(row / 3) * 3;\n col = Math.floor(col / 3) * 3;\n return `S${String.fromCharCode(firstRowIdChar + row)}${String.fromCharCode(\n firstColIdChar + col\n )}` as CageId;\n }\n\n public static cellIds(\n firstRow: number,\n numRows: number,\n firstCol: number,\n numCols: number\n ): Result<CellId[]> {\n const cellIds: CellId[] = [];\n for (let row = firstRow; row < firstRow + numRows; row++) {\n for (let col = firstCol; col < firstCol + numCols; col++) {\n const result = this.cellId({ row, col }).onSuccess((id) => {\n cellIds.push(id);\n return succeed(id);\n });\n\n /* c8 ignore next 3 - defense in depth should not happen */\n if (result.isFailure()) {\n return fail(result.message);\n }\n }\n }\n return succeed(cellIds);\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import * as Converters from './converters';
2
+ export * from './cage';
3
+ export * from './cell';
4
+ export * from './common';
5
+ export { Ids } from './ids';
6
+ export * from './model';
7
+ export * from './public';
8
+ export * from './puzzle';
9
+ export * from './puzzleSession';
10
+ export * from './puzzleState';
11
+ export { Converters };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ /*
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2023 Erik Fortune
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ var desc = Object.getOwnPropertyDescriptor(m, k);
28
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
29
+ desc = { enumerable: true, get: function() { return m[k]; } };
30
+ }
31
+ Object.defineProperty(o, k2, desc);
32
+ }) : (function(o, m, k, k2) {
33
+ if (k2 === undefined) k2 = k;
34
+ o[k2] = m[k];
35
+ }));
36
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
37
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
38
+ }) : function(o, v) {
39
+ o["default"] = v;
40
+ });
41
+ var __importStar = (this && this.__importStar) || function (mod) {
42
+ if (mod && mod.__esModule) return mod;
43
+ var result = {};
44
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
45
+ __setModuleDefault(result, mod);
46
+ return result;
47
+ };
48
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
49
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
50
+ };
51
+ Object.defineProperty(exports, "__esModule", { value: true });
52
+ exports.Converters = exports.Ids = void 0;
53
+ const Converters = __importStar(require("./converters"));
54
+ exports.Converters = Converters;
55
+ __exportStar(require("./cage"), exports);
56
+ __exportStar(require("./cell"), exports);
57
+ __exportStar(require("./common"), exports);
58
+ var ids_1 = require("./ids");
59
+ Object.defineProperty(exports, "Ids", { enumerable: true, get: function () { return ids_1.Ids; } });
60
+ __exportStar(require("./model"), exports);
61
+ __exportStar(require("./public"), exports);
62
+ __exportStar(require("./puzzle"), exports);
63
+ __exportStar(require("./puzzleSession"), exports);
64
+ __exportStar(require("./puzzleState"), exports);
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA2C;AAYlC,gCAAU;AAVnB,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC;AAChC,gDAA8B","sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2023 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Converters from './converters';\n\nexport * from './cage';\nexport * from './cell';\nexport * from './common';\nexport { Ids } from './ids';\nexport * from './model';\nexport * from './public';\nexport * from './puzzle';\nexport * from './puzzleSession';\nexport * from './puzzleState';\n\nexport { Converters };\n"]}
@@ -0,0 +1,15 @@
1
+ import { PuzzleType } from './common';
2
+ /**
3
+ * Description of a single puzzle.
4
+ * @public
5
+ */
6
+ export interface IPuzzleDescription {
7
+ id?: string;
8
+ description: string;
9
+ type: PuzzleType;
10
+ level: number;
11
+ rows: number;
12
+ cols: number;
13
+ cells: string;
14
+ }
15
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/model.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2023 Erik Fortune
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ //# sourceMappingURL=model.js.map