mons-rules 0.4.2 → 0.4.4
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 +22 -21
- package/dist/mons-rules.js +1 -1
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -19,39 +19,40 @@ const inputs: Input[] = [
|
|
|
19
19
|
{ kind: "position", position: { row: 10, column: 5 } },
|
|
20
20
|
{ kind: "position", position: { row: 9, column: 4 } },
|
|
21
21
|
];
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
const preview = game.preview(inputs);
|
|
24
|
+
if (preview.kind === "complete") {
|
|
25
|
+
game.play(inputs);
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
const suggestion = game.suggestMove("pro");
|
|
29
|
+
if (suggestion !== undefined) {
|
|
30
|
+
game.play(suggestion.inputs);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const restored = Game.fromFen(game.toFen());
|
|
24
34
|
```
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
`Game.fromFen
|
|
36
|
+
`preview` resolves typed inputs without mutation. `play` and `playFen` apply
|
|
37
|
+
only complete legal moves. `toFen` serializes canonical game state and
|
|
38
|
+
`Game.fromFen` restores it.
|
|
29
39
|
|
|
30
|
-
Fast and
|
|
31
|
-
can vary with runtime
|
|
32
|
-
|
|
33
|
-
use the canonical Fast and Normal selectors instead of the packed search path.
|
|
40
|
+
Fast, Normal, and Pro automove search is cooperatively time-bounded. Exact
|
|
41
|
+
moves can vary with runtime timing, but returned suggestions are complete,
|
|
42
|
+
legal, and do not mutate the source game.
|
|
34
43
|
|
|
35
|
-
Published JavaScript targets
|
|
36
|
-
`
|
|
37
|
-
required for Node consumers and repository tooling.
|
|
44
|
+
Published JavaScript targets ES2022 and automove uses the Web-standard
|
|
45
|
+
`performance.now()` clock. Node.js 22.13 through 22.x, or Node.js 24 or newer,
|
|
46
|
+
is required for Node consumers and repository tooling.
|
|
38
47
|
|
|
39
48
|
## Validate
|
|
40
49
|
|
|
41
50
|
```sh
|
|
42
|
-
npm ci --engine-strict
|
|
43
51
|
npm run check
|
|
44
52
|
```
|
|
45
53
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
```sh
|
|
50
|
-
node ./scripts/run-complete-games.mjs --check-only
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
The repository's intended dependency boundaries and tooling layout are
|
|
54
|
-
described in [docs/architecture.md on GitHub](https://github.com/supermetalmons/rules/blob/main/docs/architecture.md).
|
|
54
|
+
Maintainer boundaries and immutable-data rules are in
|
|
55
|
+
[docs/architecture.md on GitHub](https://github.com/supermetalmons/rules/blob/main/docs/architecture.md).
|
|
55
56
|
|
|
56
57
|
## Release
|
|
57
58
|
|