@cogniplay/logic-games-sheet 0.3.0 → 0.4.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.
- package/README.md +7 -4
- package/limits.d.ts +19 -4
- package/limits.d.ts.map +1 -1
- package/limits.js +42 -4
- package/limits.js.map +1 -1
- package/package.json +2 -2
- package/sheet.d.ts.map +1 -1
- package/sheet.js +14 -5
- package/sheet.js.map +1 -1
- package/src/limits.ts +50 -3
- package/src/sheet.ts +14 -4
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @cogniplay/logic-games-sheet
|
|
2
2
|
|
|
3
|
-
Makes the child's printed sheet for a logic-game instance: a one-page PDF with the board at the exact size of the kit's pieces, the variant's title, the instance's instruction and the instance's code. For a Line Counts, a Build a Bridge
|
|
3
|
+
Makes the child's printed sheet for a logic-game instance: a one-page PDF with the board at the exact size of the kit's pieces, the variant's title, the instance's instruction and the instance's code. For a Line Counts, a Build a Bridge, a Fill the Shape or a Build the Mirror Image board it also shows the pieces to place, and for a Fair Shares board the pieces to share. The same function serves the content repository's play-test prints in Node and, later, the `/edu` print button in the browser.
|
|
4
4
|
|
|
5
|
-
It builds on `@cogniplay/logic-games`, which draws the board, and on pdfmake 0.3, which lays the page out and embeds the font. The designs are in `docs/superpowers/specs/2026-11-05-logic-games-sheet-design.md`, `docs/superpowers/specs/2026-11-10-line-counts-drawing-design.md`, `docs/superpowers/specs/2026-11-11-fair-shares-drawing-design.md`, `docs/superpowers/specs/2026-11-17-build-a-bridge-drawing-design.md
|
|
5
|
+
It builds on `@cogniplay/logic-games`, which draws the board, and on pdfmake 0.3, which lays the page out and embeds the font. The designs are in `docs/superpowers/specs/2026-11-05-logic-games-sheet-design.md`, `docs/superpowers/specs/2026-11-10-line-counts-drawing-design.md`, `docs/superpowers/specs/2026-11-11-fair-shares-drawing-design.md`, `docs/superpowers/specs/2026-11-17-build-a-bridge-drawing-design.md`, `docs/superpowers/specs/2026-11-24-fill-the-shape-drawing-design.md` and `docs/superpowers/specs/2026-11-26-build-the-mirror-image-drawing-design.md`.
|
|
6
6
|
|
|
7
7
|
## Installing
|
|
8
8
|
|
|
@@ -58,7 +58,7 @@ const bytes = await renderSheets([first, second, third], { title: "Tuesday, year
|
|
|
58
58
|
|
|
59
59
|
One page, A4 or Letter, with 10 mm margins. From the top: the variant's title, when one is given; the instruction; the board, drawn by the renderer at the cell size and centred in the room left; and at the bottom the code with a label and, when a link is given, a QR code to the instance's page. The page is portrait when the board fits upright and landscape otherwise.
|
|
60
60
|
|
|
61
|
-
The pieces on the board print as ghosts, thin outlines with light stripes, since the child covers them with the real pieces. A Line Counts board's clues print beside it, and its pieces to place print under it at half scale, as tiles in the kit's colours or in grey: they say which pieces to take, and the child matches them by shape. A Fair Shares board's grids print at true size, as many side by side as fit, with its pieces to share above them at half scale in the same way. Nothing on its sheet marks a place for a piece to leave out, and nothing prints the shares' sizes or the difference to reach. A Build a Bridge board prints at true size with its circles and squares, any piece already in place solid grey, and its pieces to place under it at half scale as Line Counts' are; with two paths each carries its path's symbol. A Fill the Shape board prints as a Build a Bridge board does, without marks or symbols: the outline at true size with its holes hatched.
|
|
61
|
+
The pieces on the board print as ghosts, thin outlines with light stripes, since the child covers them with the real pieces. A Line Counts board's clues print beside it, and its pieces to place print under it at half scale, as tiles in the kit's colours or in grey: they say which pieces to take, and the child matches them by shape. A Fair Shares board's grids print at true size, as many side by side as fit, with its pieces to share above them at half scale in the same way. Nothing on its sheet marks a place for a piece to leave out, and nothing prints the shares' sizes or the difference to reach. A Build a Bridge board prints at true size with its circles and squares, any piece already in place solid grey, and its pieces to place under it at half scale as Line Counts' are; with two paths each carries its path's symbol. A Fill the Shape board prints as a Build a Bridge board does, without marks or symbols: the outline at true size with its holes hatched. A Build the Mirror Image board prints as a Fill the Shape board does, with the pattern's grid beside it: the grey pattern, the axis or the point O, the empty board and any piece already in place solid grey, at true size, and the pieces to place under both grids.
|
|
62
62
|
|
|
63
63
|
The PDF states its sizes in physical units and asks viewers not to scale it (`PrintScaling: None`). For viewers that ignore that, Edu tells the teacher to print at actual size.
|
|
64
64
|
|
|
@@ -82,6 +82,8 @@ For Build a Bridge the footprint is Line Counts' without clues: the board's cell
|
|
|
82
82
|
|
|
83
83
|
Fill the Shape's footprint is Build a Bridge's. The first round's outlines lie in a box of at most 6×5, or are rectangles of up to 32 cells; 6×5 with the whole kit on offer takes 96×112 mm, upright.
|
|
84
84
|
|
|
85
|
+
For Build the Mirror Image the footprint is the bounding box of the board and its image, the pattern's grid, with any gap the data leaves at the axis; the axis's 3 mm past both its ends, 6 mm more down for a vertical axis and 6 mm more across for a horizontal one, nothing for a half turn's point; and two cells more down when any piece is to place. A board that fits both ways prints upright: three upright bars of 4, 3 and 2 beside a vertical axis take 160×134 mm. The largest vertical layouts print sideways, such as the handbook's T2-SQ with its gap, 256×134 mm, and the tallest, 7 rows and the pieces to place, takes all 150 mm; the horizontal axis's prints upright, 118×192 mm. The handbook's own T3-SQ layout, 7×16 cells, fits neither way, nor does a 16×3 board under a horizontal axis with pieces to place: 262 mm across.
|
|
86
|
+
|
|
85
87
|
To tell ahead of time:
|
|
86
88
|
|
|
87
89
|
```ts
|
|
@@ -92,7 +94,7 @@ sheetOrientation(size); // "portrait", "landscape", or undefined if it fits neit
|
|
|
92
94
|
boardLimitsMm; // { upright: { width: 190, height: 219 }, sideways: { width: 259, height: 150 } }
|
|
93
95
|
```
|
|
94
96
|
|
|
95
|
-
`boardSizeMm(instance, 16)` still gives the cells' bounding box alone.
|
|
97
|
+
`boardSizeMm(instance, 16)` still gives the cells' bounding box alone; for Build the Mirror Image, the board's without its image.
|
|
96
98
|
|
|
97
99
|
`renderSheet` throws in these cases, and draws anything else it is given:
|
|
98
100
|
|
|
@@ -100,6 +102,7 @@ boardLimitsMm; // { upright: { width: 190, height: 219 }, sideways: { width: 259
|
|
|
100
102
|
- a piece or a mark so far off the board that the drawing, which the renderer widens to hold it, no longer fits the way up the cells chose: `A piece or a mark lies off the 96×96 mm board: the drawing is 258×98 mm, which fits no sheet upright`;
|
|
101
103
|
- a Line Counts board whose pieces to place need more than the two cells counted for them, such as a second row: `The clues and the pieces to place don't fit beside the 160×160 mm board: the drawing is 178×238 mm, which fits no sheet upright`;
|
|
102
104
|
- a Build a Bridge or a Fill the Shape board in the same case: `The pieces to place don't fit beside the 144×176 mm board: …`;
|
|
105
|
+
- a Build the Mirror Image board too big with its image: `A 112×96 mm board, 118×256 mm with its image, the axis's 3 mm past both ends, and the pieces to place, fits no sheet: …`, and one whose pieces need a second row: `The pieces to place don't fit beside the 112×80 mm board and its image: …`;
|
|
103
106
|
- a Fair Shares board in the same case: `The pieces to share don't fit beside the 3 grids of 80×80 mm: the drawing is 178×238 mm, which fits no sheet upright`;
|
|
104
107
|
- an instruction so long it leaves the board no room: `The instruction (1200 characters) is too long for a board this tall`. Nothing caps the instruction in the format; the content repository's validator runs the sheet for every instance and reports this failure, so the sheet fails here and never shrinks or clips the text.
|
|
105
108
|
|
package/limits.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FairSharesInstance, type GameData } from "@cogniplay/logic-games";
|
|
1
|
+
import { type FairSharesInstance, type GameData, type MirrorInstance } from "@cogniplay/logic-games";
|
|
2
2
|
/**
|
|
3
3
|
* The largest footprint a sheet holds, in millimetres, each way up: the printable
|
|
4
4
|
* area A4 and Letter share (210 × 279 mm) less 10 mm margins and a 40 mm band
|
|
@@ -24,6 +24,18 @@ export interface SizeMm {
|
|
|
24
24
|
* For Fair Shares that is one grid.
|
|
25
25
|
*/
|
|
26
26
|
export declare function boardSizeMm(instance: GameData, cellSizeMm?: number): SizeMm;
|
|
27
|
+
/**
|
|
28
|
+
* What a Build the Mirror Image board's two grids take together: the
|
|
29
|
+
* bounding box of the board and its image, the pattern's grid, with any gap
|
|
30
|
+
* the data leaves at the axis.
|
|
31
|
+
*/
|
|
32
|
+
export declare function gridsSizeMm(instance: MirrorInstance, cellSizeMm?: number): SizeMm;
|
|
33
|
+
/**
|
|
34
|
+
* How much a Build the Mirror Image axis adds along its direction: the
|
|
35
|
+
* renderer draws it 3 mm past both grids' ends, at any cell size, so 6 mm
|
|
36
|
+
* in all. A half turn's point adds nothing.
|
|
37
|
+
*/
|
|
38
|
+
export declare const axisEndsMm = 6;
|
|
27
39
|
/**
|
|
28
40
|
* The cells the pieces to place, or to share, take under or above the board,
|
|
29
41
|
* at half scale: half a cell of gap and a piece up to three cells tall.
|
|
@@ -43,9 +55,12 @@ export declare function gridsAcross(instance: FairSharesInstance, cellSizeMm?: n
|
|
|
43
55
|
* when any piece is to place. For Fair Shares: its grids in rows of
|
|
44
56
|
* `gridsAcross`, a cell between two grids across and down, and two cells
|
|
45
57
|
* more down when any piece is to share. For Build a Bridge and Fill the
|
|
46
|
-
* Shape: its cells, and two cells more down when any piece is to place.
|
|
47
|
-
*
|
|
48
|
-
*
|
|
58
|
+
* Shape: its cells, and two cells more down when any piece is to place. For
|
|
59
|
+
* Build the Mirror Image: the bounding box of the board and its image, the
|
|
60
|
+
* axis's 3 mm past both its ends, 6 mm more down for a vertical axis and
|
|
61
|
+
* across for a horizontal one, and two cells more down when any piece is to
|
|
62
|
+
* place. The content repository's
|
|
63
|
+
* validator and the backend's import compute the same from the data.
|
|
49
64
|
*/
|
|
50
65
|
export declare function footprintMm(instance: GameData, cellSizeMm?: number): SizeMm;
|
|
51
66
|
/** Which way the sheet turns for a footprint, or undefined if it fits neither way. */
|
package/limits.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["src/limits.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["src/limits.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,cAAc,EAUpB,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;;;;;CAGhB,CAAC;AAEX,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAID;;;GAGG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,QAAQ,EAClB,UAAU,GAAE,MAA0B,GACrC,MAAM,CAOR;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,cAAc,EACxB,UAAU,GAAE,MAA0B,GACrC,MAAM,CAWR;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,IAAI,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAqB/B;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,kBAAkB,EAC5B,UAAU,GAAE,MAA0B,GACrC,MAAM,CAUR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,QAAQ,EAClB,UAAU,GAAE,MAA0B,GACrC,MAAM,CAqCR;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GACX,UAAU,GAAG,WAAW,GAAG,SAAS,CAMtC"}
|
package/limits.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clueBands, gridGapCells, isFairShares, isFill, isLineCounts, isLinks, isPlaced, } from "@cogniplay/logic-games";
|
|
1
|
+
import { clueBands, gridGapCells, imageOf, isFairShares, isFill, isLineCounts, isLinks, isMirror, isPlaced, } from "@cogniplay/logic-games";
|
|
2
2
|
/**
|
|
3
3
|
* The largest footprint a sheet holds, in millimetres, each way up: the printable
|
|
4
4
|
* area A4 and Letter share (210 × 279 mm) less 10 mm margins and a 40 mm band
|
|
@@ -22,6 +22,29 @@ export function boardSizeMm(instance, cellSizeMm = defaultCellSizeMm) {
|
|
|
22
22
|
height: (Math.max(...ys) - Math.min(...ys) + 1) * cellSizeMm,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* What a Build the Mirror Image board's two grids take together: the
|
|
27
|
+
* bounding box of the board and its image, the pattern's grid, with any gap
|
|
28
|
+
* the data leaves at the axis.
|
|
29
|
+
*/
|
|
30
|
+
export function gridsSizeMm(instance, cellSizeMm = defaultCellSizeMm) {
|
|
31
|
+
const cells = [
|
|
32
|
+
...instance.board,
|
|
33
|
+
...instance.board.map((cell) => imageOf(cell, instance.transform)),
|
|
34
|
+
];
|
|
35
|
+
const xs = cells.map(([x]) => x);
|
|
36
|
+
const ys = cells.map(([, y]) => y);
|
|
37
|
+
return {
|
|
38
|
+
width: (Math.max(...xs) - Math.min(...xs) + 1) * cellSizeMm,
|
|
39
|
+
height: (Math.max(...ys) - Math.min(...ys) + 1) * cellSizeMm,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* How much a Build the Mirror Image axis adds along its direction: the
|
|
44
|
+
* renderer draws it 3 mm past both grids' ends, at any cell size, so 6 mm
|
|
45
|
+
* in all. A half turn's point adds nothing.
|
|
46
|
+
*/
|
|
47
|
+
export const axisEndsMm = 6;
|
|
25
48
|
/**
|
|
26
49
|
* The cells the pieces to place, or to share, take under or above the board,
|
|
27
50
|
* at half scale: half a cell of gap and a piece up to three cells tall.
|
|
@@ -64,14 +87,29 @@ export function gridsAcross(instance, cellSizeMm = defaultCellSizeMm) {
|
|
|
64
87
|
* when any piece is to place. For Fair Shares: its grids in rows of
|
|
65
88
|
* `gridsAcross`, a cell between two grids across and down, and two cells
|
|
66
89
|
* more down when any piece is to share. For Build a Bridge and Fill the
|
|
67
|
-
* Shape: its cells, and two cells more down when any piece is to place.
|
|
68
|
-
*
|
|
69
|
-
*
|
|
90
|
+
* Shape: its cells, and two cells more down when any piece is to place. For
|
|
91
|
+
* Build the Mirror Image: the bounding box of the board and its image, the
|
|
92
|
+
* axis's 3 mm past both its ends, 6 mm more down for a vertical axis and
|
|
93
|
+
* across for a horizontal one, and two cells more down when any piece is to
|
|
94
|
+
* place. The content repository's
|
|
95
|
+
* validator and the backend's import compute the same from the data.
|
|
70
96
|
*/
|
|
71
97
|
export function footprintMm(instance, cellSizeMm = defaultCellSizeMm) {
|
|
72
98
|
if (isFairShares(instance)) {
|
|
73
99
|
return gridsFootprintMm(instance, gridsAcross(instance, cellSizeMm), cellSizeMm);
|
|
74
100
|
}
|
|
101
|
+
if (isMirror(instance)) {
|
|
102
|
+
const grids = gridsSizeMm(instance, cellSizeMm);
|
|
103
|
+
const ends = axisEndsMm;
|
|
104
|
+
const { kind } = instance.transform;
|
|
105
|
+
const toPlace = instance.pieces.some((piece) => !isPlaced(piece));
|
|
106
|
+
return {
|
|
107
|
+
width: grids.width + (kind === "horizontal-axis" ? ends : 0),
|
|
108
|
+
height: grids.height +
|
|
109
|
+
(kind === "vertical-axis" ? ends : 0) +
|
|
110
|
+
(toPlace ? trayBandCells : 0) * cellSizeMm,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
75
113
|
const board = boardSizeMm(instance, cellSizeMm);
|
|
76
114
|
if (isLinks(instance) || isFill(instance)) {
|
|
77
115
|
const toPlace = instance.pieces.some((piece) => !isPlaced(piece));
|
package/limits.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.js","sourceRoot":"","sources":["src/limits.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["src/limits.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACT,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,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J,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU;KAC1E,CAAC;AACJ,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAC9B,IAAY;IAEZ,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAC7B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;IAC3D,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QAAE,OAAO,UAAU,CAAC;IACnD,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;QAAE,OAAO,WAAW,CAAC;IACrD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cogniplay/logic-games-sheet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"pdfmake": "^0.3.13"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@cogniplay/logic-games": "^0.
|
|
18
|
+
"@cogniplay/logic-games": "^0.4.0"
|
|
19
19
|
},
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
package/sheet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["src/sheet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["src/sheet.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsVhE;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;CAKvC;AAuED,8CAA8C;AAC9C,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAE5E;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,EAAE,KAAK,EAAE,GAAE,eAAoB,GAC9B,OAAO,CAAC,UAAU,CAAC,CAKrB"}
|
package/sheet.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isFairShares, isFill, isLineCounts, isLinks, renderBoard, } from "@cogniplay/logic-games";
|
|
1
|
+
import { isFairShares, isFill, isLineCounts, isLinks, isMirror, renderBoard, } from "@cogniplay/logic-games";
|
|
2
2
|
import { boardLimitsMm, boardSizeMm, footprintMm, gridsAcross, sheetOrientation, } from "./limits.js";
|
|
3
3
|
import { configuredPdfmake, fontName } from "./pdfmake.js";
|
|
4
4
|
import { wording } from "./wording.js";
|
|
@@ -68,7 +68,13 @@ function prepare(options) {
|
|
|
68
68
|
const { upright, sideways } = boardLimitsMm;
|
|
69
69
|
const taken = footprint.width === size.width && footprint.height === size.height
|
|
70
70
|
? ""
|
|
71
|
-
:
|
|
71
|
+
: isMirror(instance)
|
|
72
|
+
? `, ${footprint.width}×${footprint.height} mm with its image, ` +
|
|
73
|
+
(instance.transform.kind === "half-turn"
|
|
74
|
+
? ""
|
|
75
|
+
: "the axis's 3 mm past both ends, ") +
|
|
76
|
+
"and the pieces to place,"
|
|
77
|
+
: `, ${footprint.width}×${footprint.height} mm with its clues and pieces,`;
|
|
72
78
|
const what = isFairShares(instance)
|
|
73
79
|
? `${instance.shares} grids of ${size.width}×${size.height} mm, ` +
|
|
74
80
|
`${footprint.width}×${footprint.height} mm with the pieces to share, fit`
|
|
@@ -86,7 +92,9 @@ function prepare(options) {
|
|
|
86
92
|
// across as the footprint counted. A Build a Bridge board's pieces to place
|
|
87
93
|
// are drawn as Line Counts' are, with their path's symbol when there are
|
|
88
94
|
// two paths; a piece already in place prints solid, since it stays. A
|
|
89
|
-
// Fill the Shape board prints as Build a Bridge's, without marks or paths
|
|
95
|
+
// Fill the Shape board prints as Build a Bridge's, without marks or paths,
|
|
96
|
+
// and a Build the Mirror Image board as Fill the Shape's, with its
|
|
97
|
+
// pattern's grid, its pattern and its axis beside it.
|
|
90
98
|
const svg = renderBoard(instance, {
|
|
91
99
|
cellSizeMm,
|
|
92
100
|
marks,
|
|
@@ -109,10 +117,11 @@ function prepare(options) {
|
|
|
109
117
|
`${size.width}×${size.height} mm: `
|
|
110
118
|
: (isLineCounts(instance)
|
|
111
119
|
? "The clues and the pieces to place don't fit beside"
|
|
112
|
-
: isLinks(instance) || isFill(instance)
|
|
120
|
+
: isLinks(instance) || isFill(instance) || isMirror(instance)
|
|
113
121
|
? "The pieces to place don't fit beside"
|
|
114
122
|
: "A piece or a mark lies off") +
|
|
115
|
-
` the ${size.width}×${size.height} mm board
|
|
123
|
+
` the ${size.width}×${size.height} mm board` +
|
|
124
|
+
(isMirror(instance) ? " and its image: " : ": ")) +
|
|
116
125
|
`the drawing is ${drawing.width}×${drawing.height} mm, which fits no sheet ` +
|
|
117
126
|
(orientation === "portrait" ? "upright" : "sideways"));
|
|
118
127
|
}
|
package/sheet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["src/sheet.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,OAAO,EACP,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,WAAW,EACX,gBAAgB,GACjB,MAAM,aAAa,CAAC;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AA2D;IAC3D,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAC5B,IAAI,CAAC,iBAAiB,KAAK,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACvC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;IAElD,OAAO,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC;AACnC,CAAC;AAED,8CAA8C;AAC9C,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAqB;IACrD,OAAO,MAAM,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAA+B,EAC/B,EAAE,KAAK,KAAsB,EAAE;IAE/B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,MAAM,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAC3C,CAAC"}
|
package/src/limits.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type FairSharesInstance,
|
|
3
3
|
type GameData,
|
|
4
|
+
type MirrorInstance,
|
|
4
5
|
clueBands,
|
|
5
6
|
gridGapCells,
|
|
7
|
+
imageOf,
|
|
6
8
|
isFairShares,
|
|
7
9
|
isFill,
|
|
8
10
|
isLineCounts,
|
|
9
11
|
isLinks,
|
|
12
|
+
isMirror,
|
|
10
13
|
isPlaced,
|
|
11
14
|
} from "@cogniplay/logic-games";
|
|
12
15
|
|
|
@@ -44,6 +47,34 @@ export function boardSizeMm(
|
|
|
44
47
|
};
|
|
45
48
|
}
|
|
46
49
|
|
|
50
|
+
/**
|
|
51
|
+
* What a Build the Mirror Image board's two grids take together: the
|
|
52
|
+
* bounding box of the board and its image, the pattern's grid, with any gap
|
|
53
|
+
* the data leaves at the axis.
|
|
54
|
+
*/
|
|
55
|
+
export function gridsSizeMm(
|
|
56
|
+
instance: MirrorInstance,
|
|
57
|
+
cellSizeMm: number = defaultCellSizeMm
|
|
58
|
+
): SizeMm {
|
|
59
|
+
const cells = [
|
|
60
|
+
...instance.board,
|
|
61
|
+
...instance.board.map((cell) => imageOf(cell, instance.transform)),
|
|
62
|
+
];
|
|
63
|
+
const xs = cells.map(([x]) => x);
|
|
64
|
+
const ys = cells.map(([, y]) => y);
|
|
65
|
+
return {
|
|
66
|
+
width: (Math.max(...xs) - Math.min(...xs) + 1) * cellSizeMm,
|
|
67
|
+
height: (Math.max(...ys) - Math.min(...ys) + 1) * cellSizeMm,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* How much a Build the Mirror Image axis adds along its direction: the
|
|
73
|
+
* renderer draws it 3 mm past both grids' ends, at any cell size, so 6 mm
|
|
74
|
+
* in all. A half turn's point adds nothing.
|
|
75
|
+
*/
|
|
76
|
+
export const axisEndsMm = 6;
|
|
77
|
+
|
|
47
78
|
/**
|
|
48
79
|
* The cells the pieces to place, or to share, take under or above the board,
|
|
49
80
|
* at half scale: half a cell of gap and a piece up to three cells tall.
|
|
@@ -97,9 +128,12 @@ export function gridsAcross(
|
|
|
97
128
|
* when any piece is to place. For Fair Shares: its grids in rows of
|
|
98
129
|
* `gridsAcross`, a cell between two grids across and down, and two cells
|
|
99
130
|
* more down when any piece is to share. For Build a Bridge and Fill the
|
|
100
|
-
* Shape: its cells, and two cells more down when any piece is to place.
|
|
101
|
-
*
|
|
102
|
-
*
|
|
131
|
+
* Shape: its cells, and two cells more down when any piece is to place. For
|
|
132
|
+
* Build the Mirror Image: the bounding box of the board and its image, the
|
|
133
|
+
* axis's 3 mm past both its ends, 6 mm more down for a vertical axis and
|
|
134
|
+
* across for a horizontal one, and two cells more down when any piece is to
|
|
135
|
+
* place. The content repository's
|
|
136
|
+
* validator and the backend's import compute the same from the data.
|
|
103
137
|
*/
|
|
104
138
|
export function footprintMm(
|
|
105
139
|
instance: GameData,
|
|
@@ -112,6 +146,19 @@ export function footprintMm(
|
|
|
112
146
|
cellSizeMm
|
|
113
147
|
);
|
|
114
148
|
}
|
|
149
|
+
if (isMirror(instance)) {
|
|
150
|
+
const grids = gridsSizeMm(instance, cellSizeMm);
|
|
151
|
+
const ends = axisEndsMm;
|
|
152
|
+
const { kind } = instance.transform;
|
|
153
|
+
const toPlace = instance.pieces.some((piece) => !isPlaced(piece));
|
|
154
|
+
return {
|
|
155
|
+
width: grids.width + (kind === "horizontal-axis" ? ends : 0),
|
|
156
|
+
height:
|
|
157
|
+
grids.height +
|
|
158
|
+
(kind === "vertical-axis" ? ends : 0) +
|
|
159
|
+
(toPlace ? trayBandCells : 0) * cellSizeMm,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
115
162
|
const board = boardSizeMm(instance, cellSizeMm);
|
|
116
163
|
if (isLinks(instance) || isFill(instance)) {
|
|
117
164
|
const toPlace = instance.pieces.some((piece) => !isPlaced(piece));
|
package/src/sheet.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
isFill,
|
|
4
4
|
isLineCounts,
|
|
5
5
|
isLinks,
|
|
6
|
+
isMirror,
|
|
6
7
|
renderBoard,
|
|
7
8
|
} from "@cogniplay/logic-games";
|
|
8
9
|
|
|
@@ -145,7 +146,13 @@ function prepare(options: SheetOptions): Prepared {
|
|
|
145
146
|
const taken =
|
|
146
147
|
footprint.width === size.width && footprint.height === size.height
|
|
147
148
|
? ""
|
|
148
|
-
:
|
|
149
|
+
: isMirror(instance)
|
|
150
|
+
? `, ${footprint.width}×${footprint.height} mm with its image, ` +
|
|
151
|
+
(instance.transform.kind === "half-turn"
|
|
152
|
+
? ""
|
|
153
|
+
: "the axis's 3 mm past both ends, ") +
|
|
154
|
+
"and the pieces to place,"
|
|
155
|
+
: `, ${footprint.width}×${footprint.height} mm with its clues and pieces,`;
|
|
149
156
|
const what = isFairShares(instance)
|
|
150
157
|
? `${instance.shares} grids of ${size.width}×${size.height} mm, ` +
|
|
151
158
|
`${footprint.width}×${footprint.height} mm with the pieces to share, fit`
|
|
@@ -168,7 +175,9 @@ function prepare(options: SheetOptions): Prepared {
|
|
|
168
175
|
// across as the footprint counted. A Build a Bridge board's pieces to place
|
|
169
176
|
// are drawn as Line Counts' are, with their path's symbol when there are
|
|
170
177
|
// two paths; a piece already in place prints solid, since it stays. A
|
|
171
|
-
// Fill the Shape board prints as Build a Bridge's, without marks or paths
|
|
178
|
+
// Fill the Shape board prints as Build a Bridge's, without marks or paths,
|
|
179
|
+
// and a Build the Mirror Image board as Fill the Shape's, with its
|
|
180
|
+
// pattern's grid, its pattern and its axis beside it.
|
|
172
181
|
const svg = renderBoard(instance, {
|
|
173
182
|
cellSizeMm,
|
|
174
183
|
marks,
|
|
@@ -195,10 +204,11 @@ function prepare(options: SheetOptions): Prepared {
|
|
|
195
204
|
`${size.width}×${size.height} mm: `
|
|
196
205
|
: (isLineCounts(instance)
|
|
197
206
|
? "The clues and the pieces to place don't fit beside"
|
|
198
|
-
: isLinks(instance) || isFill(instance)
|
|
207
|
+
: isLinks(instance) || isFill(instance) || isMirror(instance)
|
|
199
208
|
? "The pieces to place don't fit beside"
|
|
200
209
|
: "A piece or a mark lies off") +
|
|
201
|
-
` the ${size.width}×${size.height} mm board
|
|
210
|
+
` the ${size.width}×${size.height} mm board` +
|
|
211
|
+
(isMirror(instance) ? " and its image: " : ": ")) +
|
|
202
212
|
`the drawing is ${drawing.width}×${drawing.height} mm, which fits no sheet ` +
|
|
203
213
|
(orientation === "portrait" ? "upright" : "sideways")
|
|
204
214
|
);
|