@altnovatrail/widgets 0.1.1 → 0.1.3
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 +1 -1
- package/cores/vector.schema.json +82 -3
- package/kinds/cells/cells.handles.json +145 -0
- package/kinds/cells/cells.schema.json +652 -4
- package/kinds/cells/vectors/bishop-grid-56-d1-1.json +105 -4
- package/kinds/cells/vectors/counter-cases.json +123 -0
- package/kinds/cells/vectors/counter-div-56-d1-3.json +57 -0
- package/kinds/cells/vectors/counter-div-56-d2-1.json +773 -0
- package/kinds/cells/vectors/counter-div-56-d2-3.json +65 -0
- package/kinds/cells/vectors/counter-div-56-d4-1.json +57 -0
- package/kinds/cells/vectors/counter-div-56-d4-2.json +106 -0
- package/kinds/cells/vectors/cut-cases.json +163 -0
- package/kinds/cells/vectors/cut-gaps-56-d2-1.json +142 -0
- package/kinds/cells/vectors/cut-grid-56-d2-4.json +45 -0
- package/kinds/cells/vectors/cut-grid-56-d4-1.json +154 -0
- package/kinds/cells/vectors/cut-grid-56-d4-2.json +136 -0
- package/kinds/cells/vectors/cut-invalid.json +48 -0
- package/kinds/cells/vectors/domino-grid-56-d3-2.json +238 -0
- package/kinds/cells/vectors/domino-limit.json +60 -0
- package/kinds/cells/vectors/domino-par-56-d3-2.json +194 -0
- package/kinds/cells/vectors/domino-par-56-d4-3.json +127 -0
- package/kinds/cells/vectors/figure-apart.json +47 -0
- package/kinds/cells/vectors/fold-12x12.json +79 -0
- package/kinds/cells/vectors/fold-14x14.json +79 -0
- package/kinds/cells/vectors/fold-26x26.json +79 -0
- package/kinds/cells/vectors/garden-enum-56-d3-4.json +96 -6
- package/kinds/cells/vectors/goat-grid-56-d4-4.json +325 -5
- package/kinds/cells/vectors/mosaic-grid-56-d2-2.json +84 -0
- package/kinds/cells/vectors/nodes-gaps-56-d2-2.json +44 -0
- package/kinds/cells/vectors/nodes-gaps-56-d4-2.json +70 -0
- package/kinds/cells/vectors/number-div-56-d2-2.json +49 -0
- package/kinds/cells/vectors/numbers-div-56-d3-1.json +24 -0
- package/kinds/cells/vectors/numbers-invalid.json +56 -0
- package/kinds/cells/vectors/paper-26x26.json +743 -0
- package/kinds/cells/vectors/paper-cube-12-d2-1.json +43 -19
- package/kinds/cells/vectors/paper-cube-12-d5-1.json +47 -4
- package/kinds/cells/vectors/paper-cube-56-d4-1.json +56 -5
- package/kinds/cells/vectors/paper-drawn-lines.json +149 -0
- package/kinds/cells/vectors/paper-grid-56-d1-2.json +46 -5
- package/kinds/cells/vectors/paper-turn-invalid.json +4 -4
- package/kinds/cells/vectors/path-6x6.json +119 -0
- package/kinds/cells/vectors/path-beside.json +108 -0
- package/kinds/cells/vectors/path-enum-12-d3-5.json +187 -0
- package/kinds/cells/vectors/path-enum-34-d4-3.json +412 -0
- package/kinds/cells/vectors/path-enum-56-d3-3.json +411 -0
- package/kinds/cells/vectors/path-enum-56-d3-5.json +351 -0
- package/kinds/cells/vectors/path-invalid.json +37 -0
- package/kinds/cells/vectors/path-limit.json +58 -0
- package/kinds/cells/vectors/path-maze.json +297 -0
- package/kinds/cells/vectors/path-unreachable.json +76 -0
- package/kinds/cells/vectors/perimeter-grid-56-d2-1.json +86 -0
- package/kinds/cells/vectors/perimeter-grid-56-d3-1.json +102 -0
- package/kinds/cells/vectors/perimeter-grid-56-d3-3.json +112 -0
- package/kinds/cells/vectors/perimeter-grid-56-d4-3.json +289 -0
- package/kinds/cells/vectors/polyomino-cases.json +191 -0
- package/kinds/cells/vectors/polyomino-grid-56-d3-4.json +205 -0
- package/kinds/cells/vectors/polyomino-grid-56-d4-1.json +137 -0
- package/kinds/cells/vectors/polyomino-grid-56-d5-3.json +157 -0
- package/kinds/cells/vectors/polyomino-invalid.json +45 -0
- package/kinds/cells/vectors/route-par-56-d3-3.json +245 -0
- package/kinds/cells/vectors/sides-gaps-56-d3-2.json +44 -0
- package/kinds/cells/vectors/sieve-div-56-d3-2.json +140 -0
- package/kinds/cells/vectors/tear-gaps-56-d3-1.json +84 -0
- package/kinds/cells/vectors/tear-limit.json +56 -0
- package/lib/cores/enumerate.d.ts +33 -0
- package/lib/cores/enumerate.js +77 -0
- package/lib/cores/kind.d.ts +55 -5
- package/lib/cores/search.d.ts +27 -8
- package/lib/cores/search.js +85 -28
- package/lib/kinds/cells/bishop.d.ts +1 -1
- package/lib/kinds/cells/bishop.js +1 -1
- package/lib/kinds/cells/counter.d.ts +26 -0
- package/lib/kinds/cells/counter.js +249 -0
- package/lib/kinds/cells/cut.d.ts +46 -0
- package/lib/kinds/cells/cut.js +400 -0
- package/lib/kinds/cells/figure.d.ts +13 -0
- package/lib/kinds/cells/figure.js +114 -0
- package/lib/kinds/cells/holes.d.ts +6 -0
- package/lib/kinds/cells/holes.js +57 -0
- package/lib/kinds/cells/kind.js +4 -2
- package/lib/kinds/cells/number.d.ts +6 -0
- package/lib/kinds/cells/number.js +32 -0
- package/lib/kinds/cells/operation.d.ts +12 -6
- package/lib/kinds/cells/paper.d.ts +10 -2
- package/lib/kinds/cells/paper.js +90 -8
- package/lib/kinds/cells/path.d.ts +38 -0
- package/lib/kinds/cells/path.js +288 -0
- package/lib/kinds/cells/piece.d.ts +10 -1
- package/lib/kinds/cells/piece.js +87 -3
- package/lib/kinds/cells/polyomino.d.ts +45 -0
- package/lib/kinds/cells/polyomino.js +450 -0
- package/lib/kinds/cells/registry.js +35 -4
- package/lib/kinds/cells/schema.js +41 -3
- package/lib/kinds/cells/sheet.d.ts +20 -1
- package/lib/kinds/cells/sheet.js +84 -6
- package/lib/kinds/cells/side.d.ts +33 -0
- package/lib/kinds/cells/side.js +86 -0
- package/lib/kinds/cells/sieve.d.ts +26 -0
- package/lib/kinds/cells/sieve.js +208 -0
- package/lib/kinds/cells/step.d.ts +1 -1
- package/lib/kinds/cells/step.js +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Goal, Operation } from "./operation.js";
|
|
2
|
+
import { type Sheet, type State } from "./sheet.js";
|
|
3
|
+
/** The most cells of the shapes a count of cells gives: every shape of so many is listed. */
|
|
4
|
+
export declare const mostCells = 6;
|
|
5
|
+
export interface PolyominoOptions {
|
|
6
|
+
/** How many figures may lie on the sheet at once. */
|
|
7
|
+
readonly pieces: number;
|
|
8
|
+
/**
|
|
9
|
+
* Every place a figure may lie, each its cells by index in reading order, ordered by those cells;
|
|
10
|
+
* a move lays one of them.
|
|
11
|
+
*/
|
|
12
|
+
readonly placings: readonly (readonly number[])[];
|
|
13
|
+
/** The index of each place among placings, by its cells' indices joined by commas. */
|
|
14
|
+
readonly placed: ReadonlyMap<string, number>;
|
|
15
|
+
}
|
|
16
|
+
/** The figures a state has laid, by their places, and the cells they cover. */
|
|
17
|
+
export interface Laid {
|
|
18
|
+
readonly figures: readonly number[];
|
|
19
|
+
readonly covered: ReadonlySet<number>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The figures of the state, or undefined where its member "polyomino" is no list of places the
|
|
23
|
+
* scene's figures may lie on, apart, each its cells in reading order, ordered by their first cells,
|
|
24
|
+
* no more than the pieces — a state reported from outside the kind may hold one, and then no figure
|
|
25
|
+
* is laid or lifted from it and no goal is met.
|
|
26
|
+
*/
|
|
27
|
+
export declare function laidOf(sheet: Sheet, options: PolyominoOptions, state: State): Laid | undefined;
|
|
28
|
+
export declare const polyomino: Operation<PolyominoOptions>;
|
|
29
|
+
/** What a goal of the figures reads of the scene: the figures' own parameters, where they read. */
|
|
30
|
+
interface Figures {
|
|
31
|
+
readonly polyomino?: PolyominoOptions;
|
|
32
|
+
}
|
|
33
|
+
/** The figures cover every cell but the holes; the key is the fewest figures. */
|
|
34
|
+
export declare const polyominoCover: Goal<Figures>;
|
|
35
|
+
/** As polyomino_cover, and the key counts the ways. */
|
|
36
|
+
export declare const polyominoTilings: Goal<Figures>;
|
|
37
|
+
/** Any figures; the key is the most figures that lie on the sheet at once. */
|
|
38
|
+
export declare const polyominoMost: Goal<Figures>;
|
|
39
|
+
/** Any figures; the key is the fewest cells left empty, no figure on them, the holes aside. */
|
|
40
|
+
export declare const polyominoEmpty: Goal<Figures>;
|
|
41
|
+
/** One figure on the sheet; the key counts its places. */
|
|
42
|
+
export declare const polyominoPlacings: Goal<Figures>;
|
|
43
|
+
/** One figure on the sheet; the key counts its shapes up to a move, a turn and a turn over. */
|
|
44
|
+
export declare const polyominoShapes: Goal<Figures>;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
// Figures of cells joined by their sides, polyominoes, laid on the sheet and lifted off it: a
|
|
2
|
+
// domino, a tromino, a tile of four cells. The scene gives the shapes, or a count of cells for every
|
|
3
|
+
// shape of so many, and whether a figure may be turned and turned over; a figure covers whole cells,
|
|
4
|
+
// never a hole or another figure, and lies over a wall and over paint, which it knows nothing of.
|
|
5
|
+
// The state keeps the figures laid, so a goal reads which cells they cover.
|
|
6
|
+
import { array, integer, isObject, object, pointer, string } from "../../cores/json.js";
|
|
7
|
+
import { cellAt, cellName, cellPattern, readCell } from "./sheet.js";
|
|
8
|
+
/** The most cells of the shapes a count of cells gives: every shape of so many is listed. */
|
|
9
|
+
export const mostCells = 6;
|
|
10
|
+
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
11
|
+
/** A cell's name read as a square of a shape's own grid. */
|
|
12
|
+
function square(name) {
|
|
13
|
+
return [letters.indexOf(name[0]), Number(name.slice(1)) - 1];
|
|
14
|
+
}
|
|
15
|
+
/** The squares moved to the grid's corner and in reading order, so that one shape has one form. */
|
|
16
|
+
function normal(squares) {
|
|
17
|
+
const top = Math.min(...squares.map(([r]) => r));
|
|
18
|
+
const left = Math.min(...squares.map(([, c]) => c));
|
|
19
|
+
return squares
|
|
20
|
+
.map(([r, c]) => [r - top, c - left])
|
|
21
|
+
.sort((a, b) => a[0] - b[0] || a[1] - b[1]);
|
|
22
|
+
}
|
|
23
|
+
const formKey = (squares) => squares.map((s) => s.join(":")).join(",");
|
|
24
|
+
/** Whether the squares are joined by their sides into one figure. */
|
|
25
|
+
function joined(squares) {
|
|
26
|
+
const keys = new Set(squares.map((s) => s.join(":")));
|
|
27
|
+
const seen = new Set([formKey(squares.slice(0, 1))]);
|
|
28
|
+
for (const queue = squares.slice(0, 1); queue.length > 0;) {
|
|
29
|
+
const [r, c] = queue.pop();
|
|
30
|
+
for (const next of [
|
|
31
|
+
[r - 1, c],
|
|
32
|
+
[r + 1, c],
|
|
33
|
+
[r, c - 1],
|
|
34
|
+
[r, c + 1],
|
|
35
|
+
]) {
|
|
36
|
+
const key = next.join(":");
|
|
37
|
+
if (keys.has(key) && !seen.has(key)) {
|
|
38
|
+
seen.add(key);
|
|
39
|
+
queue.push(next);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return seen.size === keys.size;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The forms of a shape as it may lie: as given; turned by each quarter where it may turn; turned
|
|
47
|
+
* over, its left and right changed, where it may be turned over, and turned so too where both.
|
|
48
|
+
*/
|
|
49
|
+
function forms(shape, turn, flip) {
|
|
50
|
+
const turns = (s) => {
|
|
51
|
+
const all = [normal(s)];
|
|
52
|
+
for (let i = 1; turn && i < 4; i++) {
|
|
53
|
+
all.push(normal(all[i - 1].map(([r, c]) => [c, -r])));
|
|
54
|
+
}
|
|
55
|
+
return all;
|
|
56
|
+
};
|
|
57
|
+
const all = [...turns(shape), ...(flip ? turns(shape.map(([r, c]) => [r, -c])) : [])];
|
|
58
|
+
return [...new Map(all.map((form) => [formKey(form), form])).values()];
|
|
59
|
+
}
|
|
60
|
+
/** Every shape of n squares joined by their sides, in each of the ways it may lie, each once. */
|
|
61
|
+
function everyShape(n) {
|
|
62
|
+
let shapes = [[[0, 0]]];
|
|
63
|
+
for (let size = 1; size < n; size++) {
|
|
64
|
+
const grown = new Map();
|
|
65
|
+
for (const shape of shapes) {
|
|
66
|
+
for (const [r, c] of shape) {
|
|
67
|
+
for (const next of [
|
|
68
|
+
[r - 1, c],
|
|
69
|
+
[r + 1, c],
|
|
70
|
+
[r, c - 1],
|
|
71
|
+
[r, c + 1],
|
|
72
|
+
]) {
|
|
73
|
+
if (shape.some(([a, b]) => a === next[0] && b === next[1]))
|
|
74
|
+
continue;
|
|
75
|
+
const form = normal([...shape, next]);
|
|
76
|
+
grown.set(formKey(form), form);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
shapes = [...grown.values()];
|
|
81
|
+
}
|
|
82
|
+
return shapes;
|
|
83
|
+
}
|
|
84
|
+
/** Every place on the sheet off the holes where one of the forms lies, each once, in order. */
|
|
85
|
+
function placingsOf(sheet, all) {
|
|
86
|
+
const found = new Map();
|
|
87
|
+
for (const form of all) {
|
|
88
|
+
const height = Math.max(...form.map(([r]) => r)) + 1;
|
|
89
|
+
const width = Math.max(...form.map(([, c]) => c)) + 1;
|
|
90
|
+
for (let top = 0; top + height <= sheet.rows; top++) {
|
|
91
|
+
for (let left = 0; left + width <= sheet.cols; left++) {
|
|
92
|
+
const cells = form.map(([r, c]) => (top + r) * sheet.cols + left + c);
|
|
93
|
+
if (cells.some((cell) => sheet.holes.has(cell)))
|
|
94
|
+
continue;
|
|
95
|
+
found.set(cells.join(","), cells);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return [...found.values()].sort((a, b) => {
|
|
100
|
+
for (let i = 0; i < Math.min(a.length, b.length); i++) {
|
|
101
|
+
if (a[i] !== b[i])
|
|
102
|
+
return a[i] - b[i];
|
|
103
|
+
}
|
|
104
|
+
return a.length - b.length;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
// The figures of each state read so far, by the array of its member "polyomino", for each scene's
|
|
108
|
+
// parameters: null for a member the rules never make.
|
|
109
|
+
const laidByOptions = new WeakMap();
|
|
110
|
+
/**
|
|
111
|
+
* The figures of the state, or undefined where its member "polyomino" is no list of places the
|
|
112
|
+
* scene's figures may lie on, apart, each its cells in reading order, ordered by their first cells,
|
|
113
|
+
* no more than the pieces — a state reported from outside the kind may hold one, and then no figure
|
|
114
|
+
* is laid or lifted from it and no goal is met.
|
|
115
|
+
*/
|
|
116
|
+
export function laidOf(sheet, options, state) {
|
|
117
|
+
const value = state.polyomino;
|
|
118
|
+
if (!Array.isArray(value)) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
let byOptions = laidByOptions.get(options);
|
|
122
|
+
if (byOptions === undefined) {
|
|
123
|
+
byOptions = new WeakMap();
|
|
124
|
+
laidByOptions.set(options, byOptions);
|
|
125
|
+
}
|
|
126
|
+
let laid = byOptions.get(value);
|
|
127
|
+
if (laid === undefined) {
|
|
128
|
+
laid = readLaid(sheet, options, value);
|
|
129
|
+
byOptions.set(value, laid);
|
|
130
|
+
}
|
|
131
|
+
return laid ?? undefined;
|
|
132
|
+
}
|
|
133
|
+
function readLaid(sheet, options, value) {
|
|
134
|
+
if (value.length > options.pieces)
|
|
135
|
+
return null;
|
|
136
|
+
const figures = [];
|
|
137
|
+
const covered = new Set();
|
|
138
|
+
let last = -1;
|
|
139
|
+
for (const figure of value) {
|
|
140
|
+
if (!Array.isArray(figure))
|
|
141
|
+
return null;
|
|
142
|
+
const cells = figure.map((name) => typeof name === "string" ? cellAt(sheet, name) : undefined);
|
|
143
|
+
const placing = options.placed.get(cells.join(","));
|
|
144
|
+
const first = cells[0];
|
|
145
|
+
if (placing === undefined || first === undefined || first <= last)
|
|
146
|
+
return null;
|
|
147
|
+
for (const cell of cells) {
|
|
148
|
+
if (covered.has(cell))
|
|
149
|
+
return null;
|
|
150
|
+
covered.add(cell);
|
|
151
|
+
}
|
|
152
|
+
figures.push(placing);
|
|
153
|
+
last = first;
|
|
154
|
+
}
|
|
155
|
+
return { figures, covered };
|
|
156
|
+
}
|
|
157
|
+
/** The member of the state with the figures given, by their places. */
|
|
158
|
+
function laidJson(sheet, options, figures) {
|
|
159
|
+
return [...figures]
|
|
160
|
+
.sort((a, b) => a - b)
|
|
161
|
+
.map((placing) => options.placings[placing].map((cell) => cellName(sheet, cell)));
|
|
162
|
+
}
|
|
163
|
+
function refuse(reason) {
|
|
164
|
+
return { ok: false, reason };
|
|
165
|
+
}
|
|
166
|
+
/** The cells a move names, by index, or undefined where a name is no cell of the sheet. */
|
|
167
|
+
function namedCells(sheet, value) {
|
|
168
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
169
|
+
return undefined;
|
|
170
|
+
const cells = value.map((name) => (typeof name === "string" ? cellAt(sheet, name) : undefined));
|
|
171
|
+
return cells.every((cell) => cell !== undefined) ? cells : undefined;
|
|
172
|
+
}
|
|
173
|
+
const cellList = (description, item, least) => ({
|
|
174
|
+
description,
|
|
175
|
+
type: "array",
|
|
176
|
+
items: { description: item, $ref: "#/$defs/cell" },
|
|
177
|
+
minItems: least,
|
|
178
|
+
uniqueItems: true,
|
|
179
|
+
});
|
|
180
|
+
export const polyomino = {
|
|
181
|
+
name: "polyomino",
|
|
182
|
+
schema: {
|
|
183
|
+
options: {
|
|
184
|
+
description: "Figures of cells joined by their sides laid on the sheet and lifted off it: the shapes given, or every shape of a count of cells, one of them, the count with no turn and no flip. A figure covers whole cells, never a hole or another figure; it lies over a wall and over paint.",
|
|
185
|
+
type: "object",
|
|
186
|
+
properties: {
|
|
187
|
+
shapes: {
|
|
188
|
+
description: "The shapes of the figures, a domino or any other.",
|
|
189
|
+
type: "array",
|
|
190
|
+
items: cellList("A shape, by the cells it covers on a grid of its own, as A1, A2 and B2 for an L of three cells; where on that grid does not matter. Its cells are joined by their sides.", "A cell of the shape.", 2),
|
|
191
|
+
minItems: 1,
|
|
192
|
+
},
|
|
193
|
+
cells: {
|
|
194
|
+
description: `Every shape of so many cells joined by their sides, from 2 to ${mostCells}, in every way it may lie.`,
|
|
195
|
+
type: "integer",
|
|
196
|
+
minimum: 2,
|
|
197
|
+
maximum: mostCells,
|
|
198
|
+
},
|
|
199
|
+
turn: {
|
|
200
|
+
description: "Whether a figure of the shapes given may be turned by a quarter, a half or three quarters; true where left out.",
|
|
201
|
+
type: "boolean",
|
|
202
|
+
},
|
|
203
|
+
flip: {
|
|
204
|
+
description: "Whether a figure of the shapes given may be turned over, its left and right changed; true where left out.",
|
|
205
|
+
type: "boolean",
|
|
206
|
+
},
|
|
207
|
+
pieces: {
|
|
208
|
+
description: "How many figures may lie on the sheet at once; as many as fit where left out.",
|
|
209
|
+
type: "integer",
|
|
210
|
+
minimum: 1,
|
|
211
|
+
maximum: 676,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
unevaluatedProperties: false,
|
|
215
|
+
},
|
|
216
|
+
move: {
|
|
217
|
+
description: "A figure laid, or a figure lifted.",
|
|
218
|
+
type: "object",
|
|
219
|
+
properties: {
|
|
220
|
+
lay: {
|
|
221
|
+
description: "A figure laid on the cells it covers.",
|
|
222
|
+
type: "object",
|
|
223
|
+
properties: {
|
|
224
|
+
cells: cellList("The cells the figure covers, in any order.", "A cell the figure covers.", 1),
|
|
225
|
+
},
|
|
226
|
+
required: ["cells"],
|
|
227
|
+
unevaluatedProperties: false,
|
|
228
|
+
},
|
|
229
|
+
lift: {
|
|
230
|
+
description: "The figure lifted off the cell it covers.",
|
|
231
|
+
type: "object",
|
|
232
|
+
properties: {
|
|
233
|
+
cell: { description: "A cell the figure covers.", $ref: "#/$defs/cell" },
|
|
234
|
+
},
|
|
235
|
+
required: ["cell"],
|
|
236
|
+
unevaluatedProperties: false,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
minProperties: 1,
|
|
240
|
+
maxProperties: 1,
|
|
241
|
+
unevaluatedProperties: false,
|
|
242
|
+
},
|
|
243
|
+
state: {
|
|
244
|
+
member: "polyomino",
|
|
245
|
+
schema: {
|
|
246
|
+
description: "The figures laid, each by the cells it covers in reading order, ordered by their first cells.",
|
|
247
|
+
type: "array",
|
|
248
|
+
items: cellList("A figure laid.", "A cell the figure covers.", 1),
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
read(value, sheet, path, errors) {
|
|
253
|
+
const before = errors.length;
|
|
254
|
+
const o = object(value, path, errors, [], ["shapes", "cells", "turn", "flip", "pieces"]);
|
|
255
|
+
if (o === undefined) {
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
258
|
+
const shapes = [];
|
|
259
|
+
if (o.shapes !== undefined) {
|
|
260
|
+
const at = pointer(path, "shapes");
|
|
261
|
+
array(o.shapes, at, errors, 1)?.forEach((item, i) => {
|
|
262
|
+
const here = pointer(at, i);
|
|
263
|
+
const names = [];
|
|
264
|
+
array(item, here, errors, 2)?.forEach((name, j) => {
|
|
265
|
+
const read = string(name, pointer(here, j), errors, cellPattern, "a cell's name, as A1");
|
|
266
|
+
if (read !== undefined && names.includes(read)) {
|
|
267
|
+
errors.push({ path: pointer(here, j), message: "a cell named twice" });
|
|
268
|
+
}
|
|
269
|
+
else if (read !== undefined)
|
|
270
|
+
names.push(read);
|
|
271
|
+
});
|
|
272
|
+
if (names.length < 2 || names.length !== item.length)
|
|
273
|
+
return;
|
|
274
|
+
const squares = names.map(square);
|
|
275
|
+
if (!joined(squares)) {
|
|
276
|
+
errors.push({ path: here, message: "cells not joined by their sides into one figure" });
|
|
277
|
+
}
|
|
278
|
+
else
|
|
279
|
+
shapes.push(squares);
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
const cells = o.cells === undefined
|
|
283
|
+
? undefined
|
|
284
|
+
: integer(o.cells, pointer(path, "cells"), errors, 2, mostCells);
|
|
285
|
+
if ((o.shapes === undefined) === (o.cells === undefined)) {
|
|
286
|
+
errors.push({ path, message: "the shapes or a count of cells, one of them" });
|
|
287
|
+
}
|
|
288
|
+
const flags = { turn: true, flip: true };
|
|
289
|
+
for (const flag of ["turn", "flip"]) {
|
|
290
|
+
if (o[flag] === undefined)
|
|
291
|
+
continue;
|
|
292
|
+
if (typeof o[flag] !== "boolean") {
|
|
293
|
+
errors.push({ path: pointer(path, flag), message: "true or false" });
|
|
294
|
+
}
|
|
295
|
+
else if (o.cells !== undefined) {
|
|
296
|
+
errors.push({
|
|
297
|
+
path: pointer(path, flag),
|
|
298
|
+
message: "every shape of a count of cells lies every way already",
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
else
|
|
302
|
+
flags[flag] = o[flag];
|
|
303
|
+
}
|
|
304
|
+
const pieces = o.pieces === undefined ? 676 : integer(o.pieces, pointer(path, "pieces"), errors, 1, 676);
|
|
305
|
+
if (errors.length > before || pieces === undefined) {
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
const all = cells === undefined
|
|
309
|
+
? shapes.flatMap((shape) => forms(shape, flags.turn, flags.flip))
|
|
310
|
+
: everyShape(cells);
|
|
311
|
+
const placings = placingsOf(sheet, all);
|
|
312
|
+
if (placings.length === 0) {
|
|
313
|
+
errors.push({ path, message: "no figure fits on the sheet off its holes" });
|
|
314
|
+
return undefined;
|
|
315
|
+
}
|
|
316
|
+
return {
|
|
317
|
+
pieces,
|
|
318
|
+
placings,
|
|
319
|
+
placed: new Map(placings.map((placing, i) => [placing.join(","), i])),
|
|
320
|
+
};
|
|
321
|
+
},
|
|
322
|
+
start: () => [],
|
|
323
|
+
play(sheet, options, state, move) {
|
|
324
|
+
const o = isObject(move) ? move : {};
|
|
325
|
+
const parts = Object.keys(o);
|
|
326
|
+
const part = parts.length === 1 ? parts[0] : "";
|
|
327
|
+
const inner = isObject(o[part]) ? o[part] : {};
|
|
328
|
+
const fields = Object.keys(inner);
|
|
329
|
+
if (part === "lift" && fields.length === 1 && fields[0] === "cell") {
|
|
330
|
+
const cell = readCell(sheet, inner.cell, "", []);
|
|
331
|
+
if (cell === undefined)
|
|
332
|
+
return refuse("no-cell");
|
|
333
|
+
const laid = laidOf(sheet, options, state);
|
|
334
|
+
if (laid === undefined)
|
|
335
|
+
return refuse("no-figures");
|
|
336
|
+
const figures = laid.figures.filter((placing) => !options.placings[placing].includes(cell));
|
|
337
|
+
if (figures.length === laid.figures.length)
|
|
338
|
+
return refuse("not-laid");
|
|
339
|
+
return { ok: true, state: { ...state, polyomino: laidJson(sheet, options, figures) } };
|
|
340
|
+
}
|
|
341
|
+
const cells = part === "lay" && fields.length === 1 && fields[0] === "cells"
|
|
342
|
+
? namedCells(sheet, inner.cells)
|
|
343
|
+
: undefined;
|
|
344
|
+
if (cells === undefined)
|
|
345
|
+
return refuse("no-cell");
|
|
346
|
+
const laid = laidOf(sheet, options, state);
|
|
347
|
+
if (laid === undefined)
|
|
348
|
+
return refuse("no-figures");
|
|
349
|
+
if (laid.figures.length >= options.pieces)
|
|
350
|
+
return refuse("all-laid");
|
|
351
|
+
if (cells.some((cell) => sheet.holes.has(cell)))
|
|
352
|
+
return refuse("hole");
|
|
353
|
+
const placing = options.placed.get([...cells].sort((a, b) => a - b).join(","));
|
|
354
|
+
if (placing === undefined || new Set(cells).size !== cells.length)
|
|
355
|
+
return refuse("not-a-shape");
|
|
356
|
+
if (cells.some((cell) => laid.covered.has(cell)))
|
|
357
|
+
return refuse("overlap");
|
|
358
|
+
return {
|
|
359
|
+
ok: true,
|
|
360
|
+
state: { ...state, polyomino: laidJson(sheet, options, [...laid.figures, placing]) },
|
|
361
|
+
};
|
|
362
|
+
},
|
|
363
|
+
// Only figures laid: a figure lifted leaves a state the figures left reach as well.
|
|
364
|
+
moves(sheet, options, state) {
|
|
365
|
+
const laid = laidOf(sheet, options, state);
|
|
366
|
+
if (laid === undefined || laid.figures.length >= options.pieces) {
|
|
367
|
+
return [];
|
|
368
|
+
}
|
|
369
|
+
return options.placings
|
|
370
|
+
.filter((placing) => placing.every((cell) => !laid.covered.has(cell)))
|
|
371
|
+
.map((placing) => ({ lay: { cells: placing.map((cell) => cellName(sheet, cell)) } }));
|
|
372
|
+
},
|
|
373
|
+
};
|
|
374
|
+
/** The goal's figures, the polyomino's parameters given, or an error where the scene lays none. */
|
|
375
|
+
function readFigures(value, path, errors, operations, alone) {
|
|
376
|
+
const before = errors.length;
|
|
377
|
+
object(value, path, errors, []);
|
|
378
|
+
if (!operations.has("polyomino")) {
|
|
379
|
+
errors.push({ path, message: "the scene allows no operation polyomino, so no figure is laid" });
|
|
380
|
+
}
|
|
381
|
+
const others = [...operations]
|
|
382
|
+
.filter(([named, options]) => named !== "polyomino" && options !== undefined)
|
|
383
|
+
.map(([named]) => named);
|
|
384
|
+
if (alone && operations.get("polyomino") !== undefined && others.length > 0) {
|
|
385
|
+
errors.push({
|
|
386
|
+
path,
|
|
387
|
+
message: `the scene allows ${others.join(", ")} beside polyomino: a count of figures counts the figures' states alone`,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
const options = operations.get("polyomino");
|
|
391
|
+
return errors.length > before ? undefined : options === undefined ? {} : { polyomino: options };
|
|
392
|
+
}
|
|
393
|
+
/** The figures of the state as a goal reads them, by the figures' parameters where they read. */
|
|
394
|
+
function figuresOf(sheet, goal, state) {
|
|
395
|
+
return goal.polyomino === undefined ? undefined : laidOf(sheet, goal.polyomino, state);
|
|
396
|
+
}
|
|
397
|
+
/** The cells of the sheet that are no hole. */
|
|
398
|
+
const free = (sheet) => sheet.rows * sheet.cols - sheet.holes.size;
|
|
399
|
+
function goalOf(name, description, alone, meets, asks) {
|
|
400
|
+
return {
|
|
401
|
+
name,
|
|
402
|
+
schema: {
|
|
403
|
+
description: `${description} The scene allows the operation polyomino${alone ? " alone, so that its states are the figures" : ""}.`,
|
|
404
|
+
type: "object",
|
|
405
|
+
unevaluatedProperties: false,
|
|
406
|
+
},
|
|
407
|
+
read: (value, _sheet, path, errors, operations) => readFigures(value, path, errors, operations, alone),
|
|
408
|
+
meets(sheet, goal, state) {
|
|
409
|
+
const laid = figuresOf(sheet, goal, state);
|
|
410
|
+
return laid !== undefined && meets(sheet, laid);
|
|
411
|
+
},
|
|
412
|
+
...(asks === undefined ? {} : { asks }),
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
const covers = (sheet, laid) => laid.covered.size === free(sheet);
|
|
416
|
+
const one = (_sheet, laid) => laid.figures.length === 1;
|
|
417
|
+
/** The figures cover every cell but the holes; the key is the fewest figures. */
|
|
418
|
+
export const polyominoCover = goalOf("polyomino_cover", "The figures cover every cell that is no hole; the key is the fewest figures laid.", false, covers);
|
|
419
|
+
/** As polyomino_cover, and the key counts the ways. */
|
|
420
|
+
export const polyominoTilings = goalOf("polyomino_tilings", "The figures cover every cell that is no hole; the key counts the ways, two ways one where their figures cover the same cells.", true, covers, () => ({ key: "count" }));
|
|
421
|
+
/** Any figures; the key is the most figures that lie on the sheet at once. */
|
|
422
|
+
export const polyominoMost = goalOf("polyomino_most", "Met by every state; the key is the most figures that lie on the sheet at once.", false, () => true, (sheet, goal) => ({
|
|
423
|
+
key: "max",
|
|
424
|
+
measure: (state) => figuresOf(sheet, goal, state)?.figures.length ?? 0,
|
|
425
|
+
}));
|
|
426
|
+
/** Any figures; the key is the fewest cells left empty, no figure on them, the holes aside. */
|
|
427
|
+
export const polyominoEmpty = goalOf("polyomino_empty", "Met by every state; the key is the fewest cells that are no hole and no figure covers.", false, () => true, (sheet, goal) => ({
|
|
428
|
+
key: "min",
|
|
429
|
+
measure: (state) => free(sheet) - (figuresOf(sheet, goal, state)?.covered.size ?? 0),
|
|
430
|
+
}));
|
|
431
|
+
/** One figure on the sheet; the key counts its places. */
|
|
432
|
+
export const polyominoPlacings = goalOf("polyomino_placings", "One figure lies on the sheet; the key counts the places it may lie on, two places one where they cover the same cells.", true, one, () => ({ key: "count" }));
|
|
433
|
+
/** One figure on the sheet; the key counts its shapes up to a move, a turn and a turn over. */
|
|
434
|
+
export const polyominoShapes = goalOf("polyomino_shapes", "One figure lies on the sheet; the key counts its shapes, two figures one shape where one moved, turned or turned over lies on the other.", true, one, (sheet, goal) => ({ key: "count", images: (state) => sameShape(sheet, goal, state) }));
|
|
435
|
+
/**
|
|
436
|
+
* Every state with one figure of the state's own figure's shape, wherever on the sheet off its
|
|
437
|
+
* holes it lies, moved, turned or turned over: the class a count of shapes counts once.
|
|
438
|
+
*/
|
|
439
|
+
function sameShape(sheet, goal, state) {
|
|
440
|
+
const laid = figuresOf(sheet, goal, state);
|
|
441
|
+
const [figure] = laid?.figures ?? [];
|
|
442
|
+
if (goal.polyomino === undefined || figure === undefined) {
|
|
443
|
+
return [state];
|
|
444
|
+
}
|
|
445
|
+
const squares = goal.polyomino.placings[figure].map((cell) => [Math.floor(cell / sheet.cols), cell % sheet.cols]);
|
|
446
|
+
return placingsOf(sheet, forms(squares, true, true)).map((cells) => ({
|
|
447
|
+
...state,
|
|
448
|
+
polyomino: [cells.map((cell) => cellName(sheet, cell))],
|
|
449
|
+
}));
|
|
450
|
+
}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
// The operations and goals of the kind cells. A new operation or goal is a module of its own,
|
|
2
2
|
// listed here, with the next minor version: nothing else of the kind changes for it.
|
|
3
|
-
import { bishop, bishopOn } from "./bishop.js";
|
|
3
|
+
import { bishop, bishopOn, bishopReach } from "./bishop.js";
|
|
4
|
+
import { counter, counterIn, counterMissed } from "./counter.js";
|
|
5
|
+
import { cellsApart, cut, cutWays, nodes, parts, sides } from "./cut.js";
|
|
6
|
+
import { area, perimeter } from "./figure.js";
|
|
4
7
|
import { fold } from "./fold.js";
|
|
8
|
+
import { paperHoles } from "./holes.js";
|
|
5
9
|
import { knight, knightOn } from "./knight.js";
|
|
10
|
+
import { numberAt } from "./number.js";
|
|
6
11
|
import { paint } from "./paint.js";
|
|
7
12
|
import { allPainted, cellsPainted } from "./painted.js";
|
|
8
13
|
import { paper } from "./paper.js";
|
|
9
|
-
import {
|
|
14
|
+
import { path, pathClosed, pathCount, pathTo } from "./path.js";
|
|
15
|
+
import { polyomino, polyominoCover, polyominoEmpty, polyominoMost, polyominoPlacings, polyominoShapes, polyominoTilings, } from "./polyomino.js";
|
|
16
|
+
import { sieve, sieveLeast } from "./sieve.js";
|
|
17
|
+
import { step, stepOn, stepReach } from "./step.js";
|
|
10
18
|
import { mirrorSymmetric, quarterTurnSymmetric } from "./symmetric.js";
|
|
11
19
|
export const registry = {
|
|
12
|
-
version: "2.
|
|
13
|
-
operations: [fold, paint, step, knight, bishop, paper],
|
|
20
|
+
version: "2.5",
|
|
21
|
+
operations: [fold, paint, step, knight, bishop, paper, counter, sieve, path, cut, polyomino],
|
|
14
22
|
goals: [
|
|
15
23
|
allPainted,
|
|
16
24
|
cellsPainted,
|
|
@@ -19,5 +27,28 @@ export const registry = {
|
|
|
19
27
|
bishopOn,
|
|
20
28
|
quarterTurnSymmetric,
|
|
21
29
|
mirrorSymmetric,
|
|
30
|
+
stepReach,
|
|
31
|
+
bishopReach,
|
|
32
|
+
paperHoles,
|
|
33
|
+
perimeter,
|
|
34
|
+
area,
|
|
35
|
+
numberAt,
|
|
36
|
+
counterIn,
|
|
37
|
+
counterMissed,
|
|
38
|
+
sieveLeast,
|
|
39
|
+
pathTo,
|
|
40
|
+
pathCount,
|
|
41
|
+
pathClosed,
|
|
42
|
+
parts,
|
|
43
|
+
cutWays,
|
|
44
|
+
cellsApart,
|
|
45
|
+
nodes,
|
|
46
|
+
sides,
|
|
47
|
+
polyominoCover,
|
|
48
|
+
polyominoTilings,
|
|
49
|
+
polyominoMost,
|
|
50
|
+
polyominoEmpty,
|
|
51
|
+
polyominoPlacings,
|
|
52
|
+
polyominoShapes,
|
|
22
53
|
],
|
|
23
54
|
};
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import { cellPattern, colors, maxSide } from "./sheet.js";
|
|
1
|
+
import { cellPattern, colors, maxFirst, maxSide } from "./sheet.js";
|
|
2
|
+
import { nodePattern, sidePattern } from "./side.js";
|
|
2
3
|
/** The $id of the kind's schema at a version: a name, which need not resolve. */
|
|
3
4
|
export function schemaId(version) {
|
|
4
5
|
return `https://altnovatrail.github.io/widgets/kinds/cells/${version}/cells.schema.json`;
|
|
5
6
|
}
|
|
6
7
|
const cell = (description) => ({ description, $ref: "#/$defs/cell" });
|
|
8
|
+
/** The marks of the places a name of the pattern def names, as the sheet gives them. */
|
|
9
|
+
const placeMarks = (description, def) => ({
|
|
10
|
+
description,
|
|
11
|
+
type: "object",
|
|
12
|
+
propertyNames: { $ref: `#/$defs/${def}` },
|
|
13
|
+
additionalProperties: {
|
|
14
|
+
description: "The mark of the place.",
|
|
15
|
+
$ref: "#/$defs/mark",
|
|
16
|
+
unevaluatedProperties: false,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
7
19
|
export function cellsSchema(registry) {
|
|
8
20
|
const options = {};
|
|
9
21
|
const moves = {};
|
|
@@ -56,8 +68,18 @@ export function cellsSchema(registry) {
|
|
|
56
68
|
type: "string",
|
|
57
69
|
pattern: cellPattern.source,
|
|
58
70
|
},
|
|
71
|
+
side: {
|
|
72
|
+
description: "A side of a cell by its line and the row or column it lies beside: v0 to v26 the vertical lines from the sheet's left edge, a side on one named by its row's letter, as v2:B between B2 and B3; h0 to h26 the horizontal lines from its top edge, a side on one named by its column's number, as h1:3 between A3 and B3.",
|
|
73
|
+
type: "string",
|
|
74
|
+
pattern: sidePattern.source,
|
|
75
|
+
},
|
|
76
|
+
node: {
|
|
77
|
+
description: "A node of the grid, where a vertical line crosses a horizontal one, by the two lines, as v2:h1, the corner A2, A3, B2 and B3 share; v0 is the sheet's left edge, h0 its top edge.",
|
|
78
|
+
type: "string",
|
|
79
|
+
pattern: nodePattern.source,
|
|
80
|
+
},
|
|
59
81
|
mark: {
|
|
60
|
-
description: "What a cell carries: a colour, a whole number written in it, or both.",
|
|
82
|
+
description: "What a cell, a node or a side carries: a colour, a whole number written in it, or both.",
|
|
61
83
|
type: "object",
|
|
62
84
|
properties: {
|
|
63
85
|
color: { description: "A colour, by its name.", enum: [...colors] },
|
|
@@ -81,7 +103,7 @@ export function cellsSchema(registry) {
|
|
|
81
103
|
},
|
|
82
104
|
},
|
|
83
105
|
sheet: {
|
|
84
|
-
description: "Rows and columns of cells, the cells cut out, the walls between cells, and the marks the cells carry.",
|
|
106
|
+
description: "Rows and columns of cells, the cells cut out, the walls between cells, and the marks the cells, the nodes of the grid and the sides of cells carry.",
|
|
85
107
|
type: "object",
|
|
86
108
|
properties: {
|
|
87
109
|
rows: {
|
|
@@ -117,6 +139,22 @@ export function cellsSchema(registry) {
|
|
|
117
139
|
description: "The marks the cells carry at the scene's start, none on a hole.",
|
|
118
140
|
$ref: "#/$defs/marks",
|
|
119
141
|
},
|
|
142
|
+
node_marks: placeMarks("The marks the scene gives nodes of the grid, each by the node's name, none at a node with only holes beside it; no move changes them.", "node"),
|
|
143
|
+
side_marks: placeMarks("The marks the scene gives sides of cells, each by the side's name, none on a side with only holes beside it; no move changes them.", "side"),
|
|
144
|
+
numbers: {
|
|
145
|
+
description: "The sheet as a table of numbers: its cells numbered in reading order, A1 the first number, each next cell the next number, a hole too, though nothing lies on it; a row of the table is a row of the sheet.",
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
first: {
|
|
149
|
+
description: "The number A1 holds.",
|
|
150
|
+
type: "integer",
|
|
151
|
+
minimum: 0,
|
|
152
|
+
maximum: maxFirst,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
required: ["first"],
|
|
156
|
+
unevaluatedProperties: false,
|
|
157
|
+
},
|
|
120
158
|
},
|
|
121
159
|
required: ["rows", "cols"],
|
|
122
160
|
},
|
|
@@ -4,6 +4,10 @@ export declare const colors: readonly ["red", "blue", "green", "yellow"];
|
|
|
4
4
|
export type Color = (typeof colors)[number];
|
|
5
5
|
/** The most rows, as there are letters, and the most columns. */
|
|
6
6
|
export declare const maxSide = 26;
|
|
7
|
+
/** The greatest first number of a table of numbers: its numbers stay short enough to read in a cell. */
|
|
8
|
+
export declare const maxFirst = 9999;
|
|
9
|
+
/** The greatest number a table of numbers holds, in its last cell. */
|
|
10
|
+
export declare const maxNumber: number;
|
|
7
11
|
/** The whole form of a cell's name, as the schema has it. */
|
|
8
12
|
export declare const cellPattern: RegExp;
|
|
9
13
|
/** What a cell carries: a colour, a whole number written in it, or both. */
|
|
@@ -20,6 +24,15 @@ export interface Sheet {
|
|
|
20
24
|
readonly walls: ReadonlySet<string>;
|
|
21
25
|
/** The marks the scene gives its cells. */
|
|
22
26
|
readonly marks: ReadonlyMap<number, Mark>;
|
|
27
|
+
/** The marks the scene gives nodes of the grid, by their names; none where it gives none. */
|
|
28
|
+
readonly nodeMarks?: ReadonlyMap<string, Mark>;
|
|
29
|
+
/** The marks the scene gives sides of cells, by their names; none where it gives none. */
|
|
30
|
+
readonly sideMarks?: ReadonlyMap<string, Mark>;
|
|
31
|
+
/**
|
|
32
|
+
* The number of the first cell, A1, where the sheet is a table of numbers: each cell holds the
|
|
33
|
+
* number after the one before it in reading order, a hole too, though nothing lies on it.
|
|
34
|
+
*/
|
|
35
|
+
readonly first?: number;
|
|
23
36
|
}
|
|
24
37
|
/** A state of the kind: the cells' marks under "marks", and a member for each operation that keeps one. */
|
|
25
38
|
export type State = {
|
|
@@ -29,6 +42,11 @@ export type State = {
|
|
|
29
42
|
export declare function cellName(sheet: Sheet, index: number): string;
|
|
30
43
|
/** The index of a cell by its name, or undefined where the name is malformed or off the sheet. */
|
|
31
44
|
export declare function cellAt(sheet: Sheet, name: string): number | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The first number of a table of numbers, where the sheet is one; else undefined, with an error at
|
|
47
|
+
* path whose words end in what: why what is read there needs the numbers.
|
|
48
|
+
*/
|
|
49
|
+
export declare function readTable(sheet: Sheet, path: string, errors: SceneError[], what: string): number | undefined;
|
|
32
50
|
/** Whether two cells share a side. */
|
|
33
51
|
export declare function sideBySide(sheet: Sheet, a: number, b: number): boolean;
|
|
34
52
|
/** The key of the wall between two cells, the same whichever comes first. */
|
|
@@ -41,7 +59,8 @@ export declare function readCell(sheet: Sheet, value: unknown, path: string, err
|
|
|
41
59
|
export declare function readMark(value: unknown, path: string, errors: SceneError[]): Mark | undefined;
|
|
42
60
|
/**
|
|
43
61
|
* The sheet of a scene: its size, its holes — never every cell —, its walls between cells side by
|
|
44
|
-
* side and off the holes, and the marks of its cells, none on a hole
|
|
62
|
+
* side and off the holes, and the marks of its cells, none on a hole, and of its nodes and sides,
|
|
63
|
+
* none beside holes alone; no cell named twice; and the first number, where it is a table of numbers.
|
|
45
64
|
*/
|
|
46
65
|
export declare function readSheet(value: unknown, path: string, errors: SceneError[]): Sheet | undefined;
|
|
47
66
|
/** The marks as a state holds them: a member for each marked cell, by its name. */
|