@cogniplay/logic-games 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +172 -2
  2. package/board.d.ts +102 -0
  3. package/board.d.ts.map +1 -0
  4. package/board.js +201 -0
  5. package/board.js.map +1 -0
  6. package/clues.d.ts +16 -0
  7. package/clues.d.ts.map +1 -0
  8. package/clues.js +64 -0
  9. package/clues.js.map +1 -0
  10. package/digits/generated/digits.d.ts +10 -0
  11. package/digits/generated/digits.d.ts.map +1 -0
  12. package/digits/generated/digits.js +397 -0
  13. package/digits/generated/digits.js.map +1 -0
  14. package/digits.d.ts +7 -0
  15. package/digits.d.ts.map +1 -0
  16. package/digits.js +38 -0
  17. package/digits.js.map +1 -0
  18. package/fair-shares.d.ts +20 -0
  19. package/fair-shares.d.ts.map +1 -0
  20. package/fair-shares.js +164 -0
  21. package/fair-shares.js.map +1 -0
  22. package/fills.d.ts +31 -0
  23. package/fills.d.ts.map +1 -0
  24. package/fills.js +142 -0
  25. package/fills.js.map +1 -0
  26. package/geometry.d.ts +14 -0
  27. package/geometry.d.ts.map +1 -0
  28. package/geometry.js +55 -0
  29. package/geometry.js.map +1 -0
  30. package/index.d.ts +12 -0
  31. package/index.d.ts.map +1 -0
  32. package/index.js +9 -0
  33. package/index.js.map +1 -0
  34. package/line-counts.d.ts +25 -0
  35. package/line-counts.d.ts.map +1 -0
  36. package/line-counts.js +136 -0
  37. package/line-counts.js.map +1 -0
  38. package/marks.d.ts +17 -0
  39. package/marks.d.ts.map +1 -0
  40. package/marks.js +50 -0
  41. package/marks.js.map +1 -0
  42. package/outline.d.ts +31 -0
  43. package/outline.d.ts.map +1 -0
  44. package/outline.js +150 -0
  45. package/outline.js.map +1 -0
  46. package/package.json +21 -4
  47. package/positions.d.ts +7 -0
  48. package/positions.d.ts.map +1 -0
  49. package/positions.js +28 -0
  50. package/positions.js.map +1 -0
  51. package/regions.d.ts +20 -0
  52. package/regions.d.ts.map +1 -0
  53. package/regions.js +84 -0
  54. package/regions.js.map +1 -0
  55. package/solution.d.ts +15 -0
  56. package/solution.d.ts.map +1 -0
  57. package/solution.js +50 -0
  58. package/solution.js.map +1 -0
  59. package/src/board.ts +377 -0
  60. package/src/clues.ts +91 -0
  61. package/src/digits/OFL.txt +93 -0
  62. package/src/digits/README.md +5 -0
  63. package/src/digits/generated/digits.ts +404 -0
  64. package/src/digits.ts +58 -0
  65. package/src/fair-shares.ts +257 -0
  66. package/src/fills.ts +176 -0
  67. package/src/geometry.ts +66 -0
  68. package/src/index.ts +31 -0
  69. package/src/line-counts.ts +211 -0
  70. package/src/marks.ts +68 -0
  71. package/src/outline.ts +196 -0
  72. package/src/positions.ts +35 -0
  73. package/src/regions.ts +108 -0
  74. package/src/solution.ts +75 -0
  75. package/src/svg.ts +46 -0
  76. package/src/tray.ts +114 -0
  77. package/src/types.ts +106 -0
  78. package/svg.d.ts +7 -0
  79. package/svg.d.ts.map +1 -0
  80. package/svg.js +29 -0
  81. package/svg.js.map +1 -0
  82. package/tray.d.ts +32 -0
  83. package/tray.d.ts.map +1 -0
  84. package/tray.js +58 -0
  85. package/tray.js.map +1 -0
  86. package/types.d.ts +95 -0
  87. package/types.d.ts.map +1 -0
  88. package/types.js +2 -0
  89. package/types.js.map +1 -0
@@ -0,0 +1,257 @@
1
+ import {
2
+ type RenderOptions,
3
+ defaultCellSize,
4
+ drawCells,
5
+ drawTile,
6
+ lookOf,
7
+ padding,
8
+ requireSquare,
9
+ } from "./board.js";
10
+ import { place } from "./geometry.js";
11
+ import { isPlaced, positionCount } from "./line-counts.js";
12
+ import { element, fmt, root } from "./svg.js";
13
+ import { drawTrayPieces, layTray } from "./tray.js";
14
+ import type {
15
+ Cell,
16
+ FairSharesInstance,
17
+ GameData,
18
+ LoosePiece,
19
+ SharePlacement,
20
+ } from "./types.js";
21
+
22
+ export function isFairShares(data: GameData): data is FairSharesInstance {
23
+ return data.$type === "fair-shares";
24
+ }
25
+
26
+ /** The room between two grids, across and down, in cells. */
27
+ export const gridGapCells = 1;
28
+
29
+ /** The box around a piece left out stands this far off it, as a share of the tray's cell. */
30
+ const boxMargin = 0.25;
31
+ const boxStroke = {
32
+ stroke: "#555",
33
+ "stroke-width": 0.5,
34
+ "stroke-dasharray": "2 1.5",
35
+ fill: "none",
36
+ };
37
+
38
+ const extent = (cells: readonly Cell[], axis: 0 | 1) =>
39
+ Math.max(...cells.map((cell) => cell[axis])) + 1;
40
+
41
+ /**
42
+ * A Fair Shares board as a complete SVG document: a grid for each share, all
43
+ * alike and unmarked, a cell apart, in rows of `gridsPerRow` with a short
44
+ * last row centred; and the pieces to share in a tray, above the grids unless
45
+ * `trayPosition` says under. At position 0 it is the start. At position 1 it
46
+ * is the solved board: the pieces the solution placed lie on their shares'
47
+ * grids with the heavy outline, and a piece it left out stays in the tray
48
+ * with a dashed box around it. Nothing shows a share's size.
49
+ */
50
+ export function renderFairShares(
51
+ data: FairSharesInstance,
52
+ options: RenderOptions & { position?: number } = {}
53
+ ): string {
54
+ requireSquare(data);
55
+ if (data.board.length === 0) {
56
+ throw new Error("The board has no cells");
57
+ }
58
+ const shares = data.shares;
59
+ if (!Number.isInteger(shares) || shares < 1) {
60
+ throw new Error(`A board has one share or more, not ${String(shares)}`);
61
+ }
62
+ const index = options.position ?? 0;
63
+ const count = positionCount(data);
64
+ if (!Number.isInteger(index) || index < 0 || index >= count) {
65
+ throw new RangeError(
66
+ `No position ${index}; there are ${count}, numbered 0 to ${count - 1}`
67
+ );
68
+ }
69
+ const size = options.cellSizeMm ?? defaultCellSize;
70
+ const solved = index === 1;
71
+
72
+ const placements = new Map<string, SharePlacement>();
73
+ (data.solution ?? []).forEach((placement, i) => {
74
+ if (!data.pieces.some((p) => p.pieceId === placement.pieceId)) {
75
+ throw new Error(
76
+ `Placement ${i + 1} names piece "${placement.pieceId}", which the board doesn't have`
77
+ );
78
+ }
79
+ placements.set(placement.pieceId, placement);
80
+ });
81
+
82
+ // A piece keeps the fill its place in `pieces` gives it, in the tray and on
83
+ // a grid.
84
+ const grids: {
85
+ cells: Cell[];
86
+ id: string;
87
+ order: number;
88
+ placed: boolean;
89
+ }[][] = Array.from({ length: shares }, () => []);
90
+ const loose: (LoosePiece & { order: number })[] = [];
91
+ // The pieces to share at the start, whatever the position.
92
+ const looseAtStart: typeof loose = [];
93
+ data.pieces.forEach((piece, order) => {
94
+ const starts = isPlaced(piece);
95
+ if (!starts) {
96
+ looseAtStart.push({ pieceId: piece.pieceId, shape: piece.shape, order });
97
+ }
98
+ const placement = starts
99
+ ? piece
100
+ : solved
101
+ ? placements.get(piece.pieceId)
102
+ : undefined;
103
+ if (placement === undefined) {
104
+ loose.push({ pieceId: piece.pieceId, shape: piece.shape, order });
105
+ return;
106
+ }
107
+ const grid = grids[placement.share];
108
+ if (grid === undefined) {
109
+ throw new Error(
110
+ `Piece "${piece.pieceId}" is on share ${String(placement.share)}; ` +
111
+ `the board has ${shares}, numbered 0 to ${shares - 1}`
112
+ );
113
+ }
114
+ grid.push({
115
+ cells: place(piece.shape, { ...placement, pieceId: piece.pieceId }),
116
+ id: piece.pieceId,
117
+ order,
118
+ placed: !starts,
119
+ });
120
+ });
121
+
122
+ // Every grid is drawn within the same bounds: the board's cells and any
123
+ // piece that lies off them on some grid, so nothing is clipped away.
124
+ const cells: Cell[] = [
125
+ ...data.board,
126
+ ...grids.flatMap((grid) => grid.flatMap((piece) => piece.cells)),
127
+ ];
128
+ const minX = Math.min(...cells.map(([x]) => x));
129
+ const minY = Math.min(...cells.map(([, y]) => y));
130
+ const gridWidth = (Math.max(...cells.map(([x]) => x)) - minX + 1) * size;
131
+ const gridHeight = (Math.max(...cells.map(([, y]) => y)) - minY + 1) * size;
132
+
133
+ const asked = Math.floor(options.gridsPerRow ?? NaN);
134
+ const across =
135
+ asked >= 1 ? Math.min(asked, shares) : defaultGridsPerRow(shares);
136
+ const down = Math.ceil(shares / across);
137
+ const gap = gridGapCells * size;
138
+ const span = (n: number, each: number) => n * each + (n - 1) * gap;
139
+ const gridsWidth = span(across, gridWidth);
140
+ const gridsHeight = span(down, gridHeight);
141
+
142
+ const trayCell = size * (options.trayScale ?? 1);
143
+ // With `keepTrayRoom` the tray is laid out as at the start, and the pieces
144
+ // since placed leave their room empty.
145
+ const room = layTray(
146
+ options.keepTrayRoom ? looseAtStart : loose,
147
+ trayCell,
148
+ options.trayWidthMm ?? gridsWidth
149
+ );
150
+ const stillLoose = new Set(loose.map((piece) => piece.pieceId));
151
+ const shown = room.pieces.filter(({ piece }) =>
152
+ stillLoose.has(piece.pieceId)
153
+ );
154
+ // Solved, a piece still in the tray is one the solution left out, and gets
155
+ // a box. The box needs room around the tray; kept at the start too when the
156
+ // tray's room is kept, so the two drawings are the same size.
157
+ const leavesOut =
158
+ placements.size > 0 &&
159
+ looseAtStart.some((piece) => !placements.has(piece.pieceId));
160
+ const boxed = leavesOut && (solved || options.keepTrayRoom === true);
161
+ const margin = boxed ? trayCell * boxMargin : 0;
162
+ const hasTray = room.pieces.length > 0;
163
+ const trayRoom = hasTray ? room.height + 2 * margin + size / 2 : 0;
164
+ const width = Math.max(gridsWidth, hasTray ? room.width + 2 * margin : 0);
165
+
166
+ const above = (options.trayPosition ?? "above") === "above";
167
+ const gridsTop = padding + (above ? trayRoom : 0);
168
+ const trayTop = padding + margin + (above ? 0 : gridsHeight + size / 2);
169
+ const trayLeft = padding + (width - room.width) / 2;
170
+
171
+ const boxes = !solved
172
+ ? ""
173
+ : shown
174
+ .map(({ piece, cells: shape, x, y }) =>
175
+ element("rect", {
176
+ class: "left-out-box",
177
+ "data-piece": piece.pieceId,
178
+ x: trayLeft + x - margin,
179
+ y: trayTop + y - margin,
180
+ width: extent(shape, 0) * trayCell + 2 * margin,
181
+ height: extent(shape, 1) * trayCell + 2 * margin,
182
+ rx: margin,
183
+ ...boxStroke,
184
+ })
185
+ )
186
+ .join("");
187
+ const tray =
188
+ shown.length === 0
189
+ ? ""
190
+ : element(
191
+ "g",
192
+ { class: "tray" },
193
+ boxes +
194
+ drawTrayPieces(
195
+ shown,
196
+ solved ? "piece left-out" : "piece to-share",
197
+ trayLeft,
198
+ trayTop,
199
+ trayCell,
200
+ options
201
+ )
202
+ );
203
+
204
+ const drawnGrids = element(
205
+ "g",
206
+ { class: "shares" },
207
+ grids
208
+ .map((grid, share) => {
209
+ const row = Math.floor(share / across);
210
+ const inRow = row === down - 1 ? shares - row * across : across;
211
+ // A short last row is centred under the rows above it.
212
+ const left =
213
+ padding +
214
+ (width - span(inRow, gridWidth)) / 2 +
215
+ (share % across) * (gridWidth + gap);
216
+ const top = gridsTop + row * (gridHeight + gap);
217
+ const toMm = ([x, y]: Cell): [number, number] => [
218
+ left + (x - minX) * size,
219
+ top + (y - minY) * size,
220
+ ];
221
+ return element(
222
+ "g",
223
+ { class: "share", "data-share": share },
224
+ drawCells(data.board, toMm, size) +
225
+ element(
226
+ "g",
227
+ { class: "pieces" },
228
+ grid
229
+ .map((piece) =>
230
+ drawTile(
231
+ piece.id,
232
+ piece.cells,
233
+ lookOf(piece.id, piece.order, options),
234
+ piece.placed ? "piece placed" : "piece",
235
+ piece.placed,
236
+ toMm,
237
+ size
238
+ )
239
+ )
240
+ .join("")
241
+ )
242
+ );
243
+ })
244
+ .join("")
245
+ );
246
+
247
+ return root(
248
+ Number(fmt(padding * 2 + width)),
249
+ Number(fmt(padding * 2 + gridsHeight + trayRoom)),
250
+ above ? tray + drawnGrids : drawnGrids + tray
251
+ );
252
+ }
253
+
254
+ /** As near a square of grids as there is: two across for two, three or four shares. */
255
+ export function defaultGridsPerRow(shares: number): number {
256
+ return Math.ceil(Math.sqrt(shares));
257
+ }
package/src/fills.ts ADDED
@@ -0,0 +1,176 @@
1
+ import type { Point } from "./outline.js";
2
+ import { element, fmt } from "./svg.js";
3
+
4
+ /** How many distinct piece fills there are before they repeat. */
5
+ export const fillCount = 6;
6
+
7
+ /** A piece's shape in millimetres: its cells' top-left corners, the cell size, and its outline loops, already inset. */
8
+ export interface Shape {
9
+ cells: readonly Point[];
10
+ size: number;
11
+ loops: readonly Point[][];
12
+ }
13
+
14
+ /** A piece's fill: one colour for the whole piece, and a pattern drawn on top. */
15
+ export interface Fill {
16
+ colour: string;
17
+ /** The pattern over the shape, or "" for a plain fill. */
18
+ pattern: (shape: Shape) => string;
19
+ }
20
+
21
+ const hatchStroke = { stroke: "#000", "stroke-width": 0.3 };
22
+
23
+ /**
24
+ * Segments of the lines x + y = d (or x - y = d when mirrored), d stepping by
25
+ * `spacing` from the first cell's corner, clipped to the shape's loops.
26
+ */
27
+ function diagonals(shape: Shape, mirrored: boolean, spacing: number): string {
28
+ const [first] = shape.cells;
29
+ if (first === undefined) return "";
30
+ const level = ([x, y]: Point) => (mirrored ? x - y : x + y);
31
+ const along = ([x, y]: Point) => (mirrored ? x + y : x - y);
32
+ const corners = shape.loops.flat();
33
+ const levels = corners.map(level);
34
+ const base = level(first);
35
+ const from = Math.ceil((Math.min(...levels) - base) / spacing);
36
+ const to = Math.floor((Math.max(...levels) - base) / spacing);
37
+ const parts: string[] = [];
38
+ for (let k = from; k <= to; k++) {
39
+ const d = base + k * spacing;
40
+ for (const [a, b] of crossings(shape.loops, (p) => level(p) - d, along)) {
41
+ parts.push(`M${fmt(a[0])} ${fmt(a[1])}L${fmt(b[0])} ${fmt(b[1])}`);
42
+ }
43
+ }
44
+ return parts.join("");
45
+ }
46
+
47
+ /**
48
+ * Where a line crosses the loops' edges, paired into the stretches inside the
49
+ * shape. `side` is a point's signed distance from the line; `along` orders
50
+ * points on it. An edge counts when its ends are on different sides, with a
51
+ * point on the line counted as the positive side, so a line through a corner
52
+ * is counted once if it crosses there and twice or not at all if it touches.
53
+ */
54
+ function crossings(
55
+ loops: readonly Point[][],
56
+ side: (p: Point) => number,
57
+ along: (p: Point) => number
58
+ ): [Point, Point][] {
59
+ const points: Point[] = [];
60
+ for (const loop of loops) {
61
+ loop.forEach((a, i) => {
62
+ const b = loop[(i + 1) % loop.length]!;
63
+ const sa = side(a);
64
+ const sb = side(b);
65
+ if (sa < 0 === sb < 0) return;
66
+ const t = sa / (sa - sb);
67
+ points.push([a[0] + t * (b[0] - a[0]), a[1] + t * (b[1] - a[1])]);
68
+ });
69
+ }
70
+ points.sort((p, q) => along(p) - along(q));
71
+ const pairs: [Point, Point][] = [];
72
+ for (let i = 0; i + 1 < points.length; i += 2) {
73
+ const a = points[i]!;
74
+ const b = points[i + 1]!;
75
+ if (along(b) - along(a) > 1e-6) pairs.push([a, b]);
76
+ }
77
+ return pairs;
78
+ }
79
+
80
+ function dots(shape: Shape): string {
81
+ const step = shape.size / 3;
82
+ const out: string[] = [];
83
+ for (const [x, y] of shape.cells) {
84
+ for (let i = 0; i < 3; i++) {
85
+ for (let j = 0; j < 3; j++) {
86
+ out.push(
87
+ element("circle", {
88
+ cx: x + step * (i + 0.5),
89
+ cy: y + step * (j + 0.5),
90
+ r: shape.size / 16,
91
+ fill: "#000",
92
+ })
93
+ );
94
+ }
95
+ }
96
+ }
97
+ return out.join("");
98
+ }
99
+
100
+ const plain = () => "";
101
+
102
+ /**
103
+ * The fills in order: light grey, mid grey, hatched, cross-hatched, dotted,
104
+ * white, so the first pieces read against the white board by fill and
105
+ * apart from the blockers' darker grey. None uses an id.
106
+ */
107
+ const fills: readonly Fill[] = [
108
+ { colour: "#dcdcdc", pattern: plain },
109
+ { colour: "#b3b3b3", pattern: plain },
110
+ {
111
+ colour: "#fff",
112
+ pattern: (shape) =>
113
+ element("path", {
114
+ d: diagonals(shape, false, shape.size / 4),
115
+ ...hatchStroke,
116
+ }),
117
+ },
118
+ {
119
+ colour: "#fff",
120
+ pattern: (shape) =>
121
+ element("path", {
122
+ d:
123
+ diagonals(shape, false, shape.size / 4) +
124
+ diagonals(shape, true, shape.size / 4),
125
+ ...hatchStroke,
126
+ }),
127
+ },
128
+ { colour: "#fff", pattern: dots },
129
+ { colour: "#fff", pattern: plain },
130
+ ];
131
+
132
+ /** The fill for the piece at `index` in its position's order; they cycle. */
133
+ export function pieceFill(index: number): Fill {
134
+ return fills[((index % fillCount) + fillCount) % fillCount] as Fill;
135
+ }
136
+
137
+ /** A flat fill in one colour, for a piece drawn in its kit's. */
138
+ export function flatFill(colour: string): Fill {
139
+ return { colour, pattern: plain };
140
+ }
141
+
142
+ /** The grey a ghost is drawn in when its piece has no colour. */
143
+ export const ghostGrey = "#777";
144
+
145
+ /**
146
+ * A ghost's fill: white, with wide light stripes in the piece's colour
147
+ * lightened half-way to white, or a light grey without one. Every ghost looks
148
+ * the same whatever its order, since on the child's sheet the shapes tell the
149
+ * pieces apart and the real piece covers the drawing.
150
+ */
151
+ export function ghostFill(colour: string | undefined): Fill {
152
+ const stripe = colour === undefined ? "#b3b3b3" : lighten(colour);
153
+ return {
154
+ colour: "#fff",
155
+ pattern: (shape) =>
156
+ element("path", {
157
+ d: diagonals(shape, false, shape.size / 3),
158
+ stroke: stripe,
159
+ "stroke-width": 0.3,
160
+ }),
161
+ };
162
+ }
163
+
164
+ /** The colour mixed half and half with white; a colour that isn't `#rrggbb` comes back as it is. */
165
+ export function lighten(colour: string): string {
166
+ const match = /^#([0-9a-f]{6})$/i.exec(colour);
167
+ if (match === null) return colour;
168
+ const hex = match[1] as string;
169
+ return (
170
+ "#" +
171
+ [0, 2, 4]
172
+ .map((i) => Math.round((parseInt(hex.slice(i, i + 2), 16) + 255) / 2))
173
+ .map((n) => n.toString(16).padStart(2, "0"))
174
+ .join("")
175
+ );
176
+ }
@@ -0,0 +1,66 @@
1
+ import type { Cell, Placement } from "./types.js";
2
+
3
+ /** "x,y", for sets and maps keyed by cell. */
4
+ export function cellKey(cell: Cell): string {
5
+ return `${cell[0]},${cell[1]}`;
6
+ }
7
+
8
+ function sorted(cells: readonly Cell[]): Cell[] {
9
+ return [...cells].sort((a, b) => a[1] - b[1] || a[0] - b[0]);
10
+ }
11
+
12
+ /** Shifted so the smallest x and smallest y are 0, sorted by y then x. */
13
+ export function normalise(cells: readonly Cell[]): Cell[] {
14
+ const minX = Math.min(...cells.map(([x]) => x));
15
+ const minY = Math.min(...cells.map(([, y]) => y));
16
+ return sorted(cells.map(([x, y]) => [x - minX, y - minY]));
17
+ }
18
+
19
+ /** A quarter turn clockwise, with y growing down. */
20
+ function turned(cells: readonly Cell[]): Cell[] {
21
+ return cells.map(([x, y]) => [-y, x]);
22
+ }
23
+
24
+ /** The shape's four quarter turns, normalised, without repeats. */
25
+ function turns(shape: readonly Cell[]): Cell[][] {
26
+ const out: Cell[][] = [];
27
+ const seen = new Set<string>();
28
+ let cells = [...shape];
29
+ for (let i = 0; i < 4; i++) {
30
+ const normalised = normalise(cells);
31
+ const key = normalised.map(cellKey).join(";");
32
+ if (!seen.has(key)) {
33
+ seen.add(key);
34
+ out.push(normalised);
35
+ }
36
+ cells = turned(cells);
37
+ }
38
+ return out;
39
+ }
40
+
41
+ /**
42
+ * The shape's distinct orientations, each normalised: first its quarter turns
43
+ * clockwise, starting with the shape itself, then the turns of its mirror image
44
+ * that aren't already in the list. An orientation number is a position here.
45
+ */
46
+ export function orientations(shape: readonly Cell[]): Cell[][] {
47
+ const own = turns(shape);
48
+ const seen = new Set(own.map((o) => o.map(cellKey).join(";")));
49
+ const mirrored = turns(shape.map(([x, y]) => [-x, y])).filter(
50
+ (o) => !seen.has(o.map(cellKey).join(";"))
51
+ );
52
+ return [...own, ...mirrored];
53
+ }
54
+
55
+ /** The cells a placement covers. Throws RangeError if the orientation is past the list. */
56
+ export function place(shape: readonly Cell[], placement: Placement): Cell[] {
57
+ const all = orientations(shape);
58
+ const orientation = all[placement.orientation];
59
+ if (orientation === undefined) {
60
+ throw new RangeError(
61
+ `Piece "${placement.pieceId}" has no orientation ${placement.orientation}; it has ${all.length}`
62
+ );
63
+ }
64
+ const [originX, originY] = placement.origin;
65
+ return orientation.map(([x, y]) => [x + originX, y + originY]);
66
+ }
package/src/index.ts ADDED
@@ -0,0 +1,31 @@
1
+ export type {
2
+ Cell,
3
+ Clue,
4
+ FairSharesInstance,
5
+ GameData,
6
+ Instance,
7
+ LineCountsInstance,
8
+ LoosePiece,
9
+ Mark,
10
+ Piece,
11
+ Placement,
12
+ Position,
13
+ SharePiece,
14
+ SharePlacement,
15
+ } from "./types.js";
16
+ export { normalise, orientations, place } from "./geometry.js";
17
+ export { positions } from "./positions.js";
18
+ export type { MarkCell, MarkDrawer } from "./marks.js";
19
+ export {
20
+ placeholder,
21
+ standardMarkKinds,
22
+ standardMarks,
23
+ star,
24
+ target,
25
+ } from "./marks.js";
26
+ export type { RenderOptions } from "./board.js";
27
+ export { renderBoard } from "./board.js";
28
+ export { renderSolution } from "./solution.js";
29
+ export { clueBands } from "./clues.js";
30
+ export { isLineCounts, isPlaced, positionCount } from "./line-counts.js";
31
+ export { gridGapCells, isFairShares } from "./fair-shares.js";