@altnovatrail/widgets 0.1.3 → 0.2.1

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 (82) hide show
  1. package/README.md +1 -1
  2. package/kinds/cells/cells.handles.json +3 -3
  3. package/kinds/cells/cells.schema.json +69 -9
  4. package/kinds/cells/vectors/knight-after-no-parity.json +31 -0
  5. package/kinds/cells/vectors/knight-par-56-d2-2.json +61 -6
  6. package/kinds/cells/vectors/paper-drawn-lines.json +36 -1
  7. package/kinds/cells/vectors/polyomino-one-pieces.json +28 -0
  8. package/kinds/line/line.handles.json +195 -0
  9. package/kinds/line/line.schema.json +321 -0
  10. package/kinds/line/vectors/cases.json +213 -0
  11. package/kinds/line/vectors/gaps-12-d1-1.json +140 -0
  12. package/kinds/line/vectors/gaps-12-d1-2.json +95 -0
  13. package/kinds/line/vectors/gaps-12-d1-3.json +122 -0
  14. package/kinds/line/vectors/gaps-12-d1-4.json +121 -0
  15. package/kinds/line/vectors/gaps-12-d1-5.json +87 -0
  16. package/kinds/line/vectors/gaps-12-d2-1.json +173 -0
  17. package/kinds/line/vectors/gaps-12-d2-6.json +87 -0
  18. package/kinds/line/vectors/gaps-12-d3-2.json +173 -0
  19. package/kinds/line/vectors/gaps-12-d4-4.json +168 -0
  20. package/kinds/line/vectors/gaps-12-d5-3.json +99 -0
  21. package/kinds/line/vectors/gaps-12-d5-4.json +215 -0
  22. package/kinds/line/vectors/gaps-34-d1-1.json +37 -0
  23. package/kinds/line/vectors/gaps-34-d1-2.json +130 -0
  24. package/kinds/line/vectors/gaps-34-d1-4.json +155 -0
  25. package/kinds/line/vectors/gaps-34-d1-5.json +43 -0
  26. package/kinds/line/vectors/gaps-34-d3-2.json +38 -0
  27. package/kinds/line/vectors/gaps-34-d3-5.json +177 -0
  28. package/kinds/line/vectors/gaps-34-d5-3.json +39 -0
  29. package/kinds/line/vectors/invalid-line.json +34 -0
  30. package/kinds/line/vectors/invalid-ring.json +34 -0
  31. package/kinds/line/vectors/invalid.json +43 -0
  32. package/kinds/line/vectors/jump-unreachable.json +104 -0
  33. package/kinds/line/vectors/limit.json +40 -0
  34. package/kinds/line/vectors/op-not-in-scene.json +47 -0
  35. package/kinds/line/vectors/ring-cut.json +104 -0
  36. package/kinds/line/vectors/ring-every.json +107 -0
  37. package/kinds/line/vectors/ring-jump.json +135 -0
  38. package/lib/cores/arith.d.ts +62 -0
  39. package/lib/cores/arith.js +197 -0
  40. package/lib/cores/enumerate.js +2 -2
  41. package/lib/cores/kind.d.ts +28 -3
  42. package/lib/cores/kind.js +2 -2
  43. package/lib/cores/registry.d.ts +43 -0
  44. package/lib/cores/registry.js +87 -0
  45. package/lib/cores/search.d.ts +21 -3
  46. package/lib/cores/search.js +80 -17
  47. package/lib/kinds/cells/bishop.d.ts +1 -1
  48. package/lib/kinds/cells/index.d.ts +8 -0
  49. package/lib/kinds/cells/index.js +10 -2
  50. package/lib/kinds/cells/kind.d.ts +3 -2
  51. package/lib/kinds/cells/kind.js +26 -66
  52. package/lib/kinds/cells/knight.d.ts +1 -1
  53. package/lib/kinds/cells/operation.d.ts +21 -1
  54. package/lib/kinds/cells/paper.js +27 -13
  55. package/lib/kinds/cells/piece.d.ts +17 -6
  56. package/lib/kinds/cells/piece.js +119 -38
  57. package/lib/kinds/cells/polyomino.d.ts +14 -0
  58. package/lib/kinds/cells/polyomino.js +122 -35
  59. package/lib/kinds/cells/registry.js +1 -1
  60. package/lib/kinds/cells/schema.js +4 -1
  61. package/lib/kinds/cells/step.d.ts +1 -1
  62. package/lib/kinds/line/cut.d.ts +2 -0
  63. package/lib/kinds/line/cut.js +63 -0
  64. package/lib/kinds/line/goals.d.ts +22 -0
  65. package/lib/kinds/line/goals.js +137 -0
  66. package/lib/kinds/line/index.d.ts +13 -0
  67. package/lib/kinds/line/index.js +17 -0
  68. package/lib/kinds/line/jump.d.ts +10 -0
  69. package/lib/kinds/line/jump.js +95 -0
  70. package/lib/kinds/line/kind.d.ts +25 -0
  71. package/lib/kinds/line/kind.js +125 -0
  72. package/lib/kinds/line/line.d.ts +63 -0
  73. package/lib/kinds/line/line.js +157 -0
  74. package/lib/kinds/line/operation.d.ts +69 -0
  75. package/lib/kinds/line/operation.js +1 -0
  76. package/lib/kinds/line/posts.d.ts +11 -0
  77. package/lib/kinds/line/posts.js +85 -0
  78. package/lib/kinds/line/registry.d.ts +2 -0
  79. package/lib/kinds/line/registry.js +11 -0
  80. package/lib/kinds/line/schema.d.ts +4 -0
  81. package/lib/kinds/line/schema.js +157 -0
  82. package/package.json +9 -2
package/README.md CHANGED
@@ -19,6 +19,6 @@ A component of [NovaTrail](https://github.com/altnovatrail/spec), a universal op
19
19
 
20
20
  Its widgets run in `app` through the widget host of `canvas`, in an iframe sandbox with no network; each kind has a scene schema and a solver of its own; `modules` takes its bundles at a tag and pins each by its hash, and proves each scene's key with the kinds' solvers, an npm package of the same release.
21
21
 
22
- Its design is detailed, and its first widget kind, the sheet of cells, is built: folds and paint, pieces on a board, paper folded in layers and punched, a table of numbers, paths, cuts and polyominoes; its rules and solver on the cores of search over states and of enumeration, which prove the fewest moves to a goal, a count, a maximum or a minimum, with their scene vectors, as an npm package checked the way a module's build takes it; its drawing — the sheet in perspective on a canvas, seen on the table or from above, as the learner switches —, bundled as one HTML file; the shell every kind shares; and the test host that plays it in the engines of Chromium, WebKit and Firefox. A release carries the bundle, its handles, the npm package and the list of withdrawn bundles; the releases are published, the package in npm by trusted publishing.
22
+ Its design is detailed, and two widget kinds are built. The sheet of cells: folds and paint, pieces on a board, paper folded in layers and punched, a table of numbers, paths, cuts and polyominoes, drawn in perspective on a canvas, seen on the table or from above, as the learner switches. The number line: a row of places, upright too, and a ring, with posts, cuts and a jumper, and counters of posts, gaps, length, pieces and distance, drawn flat in SVG. Their rules and solvers stand on the cores of exact arithmetic, of search over states and of enumeration, the last two proving the fewest moves to a goal, a count, a maximum or a minimum, with their scene vectors, as an npm package checked the way a module's build takes it; each kind's drawing is bundled as one HTML file, with its handles for an AI. Every kind shares the shell, which speaks the widget protocol 1.0 of spec, and the test host plays each kind in the engines of Chromium, WebKit and Firefox and passes spec's conformance tests of both sides. A release carries each kind's bundle with its bundle's file — its protocol version and the digests a host's Content Security Policy names —, its handles, the npm package and the list of withdrawn bundles by the protocol's schema; the releases are published, the package in npm by trusted publishing.
23
23
 
24
24
  Its card is in the architecture of [spec](https://github.com/altnovatrail/spec); its own documents, its decisions and its plan are in [docs/](docs/README.md).
@@ -324,7 +324,7 @@
324
324
  },
325
325
  {
326
326
  "name": "show_best_path",
327
- "description": "Show on the sheet the solver's best path from the state now to the goal: the parts each move acts on, numbered in turn. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
327
+ "description": "Show on the sheet the solver's best path from the state now to the goal — where the key is a count, to the nearest state counted; a maximum or a minimum, to its best —: the parts each move acts on, numbered in turn. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
328
328
  "inputSchema": {
329
329
  "description": "No arguments.",
330
330
  "type": "object",
@@ -334,7 +334,7 @@
334
334
  },
335
335
  {
336
336
  "name": "show_outcomes",
337
- "description": "Mark on the sheet each move the learner can make now by what it does to the fewest moves left to the goal: closer, as far, farther, or where the goal can no longer be reached. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
337
+ "description": "Mark on the sheet each move the learner can make now by what it does to the fewest moves left to the goal, as the best path leads: closer, as far, farther, or where the goal — on a maximum or a minimum, its best — can no longer be reached. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
338
338
  "inputSchema": {
339
339
  "description": "No arguments.",
340
340
  "type": "object",
@@ -344,7 +344,7 @@
344
344
  },
345
345
  {
346
346
  "name": "show_distance",
347
- "description": "Say in the widget's bar the fewest moves left from the state now to the goal, or that it can no longer be reached. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
347
+ "description": "Say in the widget's bar the fewest moves left from the state now to the goal, as the best path leads, or that it can no longer be reached; on a maximum or a minimum whose best can no longer be reached, that the goal is met, or can still be met, short of its best. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
348
348
  "inputSchema": {
349
349
  "description": "No arguments.",
350
350
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://altnovatrail.github.io/widgets/kinds/cells/2.5/cells.schema.json",
3
+ "$id": "https://altnovatrail.github.io/widgets/kinds/cells/3.1/cells.schema.json",
4
4
  "title": "A scene of the widget kind cells",
5
5
  "description": "A sheet of cells, the operations a learner may play on it with their parameters, and at most one goal a state may meet. Under $defs, a move and a state of the kind.",
6
6
  "type": "object",
@@ -59,6 +59,10 @@
59
59
  "cell": {
60
60
  "description": "The cell the piece stands on at the scene's start, not a hole.",
61
61
  "$ref": "#/$defs/cell"
62
+ },
63
+ "parity": {
64
+ "description": "Whether the state keeps, as step_parity, whether the piece has made an even or an odd count of moves; false where left out.",
65
+ "type": "boolean"
62
66
  }
63
67
  },
64
68
  "required": [
@@ -73,6 +77,10 @@
73
77
  "cell": {
74
78
  "description": "The cell the piece stands on at the scene's start, not a hole.",
75
79
  "$ref": "#/$defs/cell"
80
+ },
81
+ "parity": {
82
+ "description": "Whether the state keeps, as knight_parity, whether the piece has made an even or an odd count of moves; false where left out.",
83
+ "type": "boolean"
76
84
  }
77
85
  },
78
86
  "required": [
@@ -87,6 +95,10 @@
87
95
  "cell": {
88
96
  "description": "The cell the piece stands on at the scene's start, not a hole.",
89
97
  "$ref": "#/$defs/cell"
98
+ },
99
+ "parity": {
100
+ "description": "Whether the state keeps, as bishop_parity, whether the piece has made an even or an odd count of moves; false where left out.",
101
+ "type": "boolean"
90
102
  }
91
103
  },
92
104
  "required": [
@@ -313,12 +325,20 @@
313
325
  "unevaluatedProperties": false
314
326
  },
315
327
  "step_on": {
316
- "description": "The piece step stands on the cell; the scene allows the operation step, which keeps the piece.",
328
+ "description": "The piece step stands on the cell, after a count of moves of the parity given where one is; the scene allows the operation step, which keeps the piece.",
317
329
  "type": "object",
318
330
  "properties": {
319
331
  "cell": {
320
332
  "description": "The cell, not a hole.",
321
333
  "$ref": "#/$defs/cell"
334
+ },
335
+ "after": {
336
+ "description": "Whether the piece has made an even or an odd count of moves; the operation step of the scene then keeps their parity.",
337
+ "type": "string",
338
+ "enum": [
339
+ "even",
340
+ "odd"
341
+ ]
322
342
  }
323
343
  },
324
344
  "required": [
@@ -327,12 +347,20 @@
327
347
  "unevaluatedProperties": false
328
348
  },
329
349
  "knight_on": {
330
- "description": "The piece knight stands on the cell; the scene allows the operation knight, which keeps the piece.",
350
+ "description": "The piece knight stands on the cell, after a count of moves of the parity given where one is; the scene allows the operation knight, which keeps the piece.",
331
351
  "type": "object",
332
352
  "properties": {
333
353
  "cell": {
334
354
  "description": "The cell, not a hole.",
335
355
  "$ref": "#/$defs/cell"
356
+ },
357
+ "after": {
358
+ "description": "Whether the piece has made an even or an odd count of moves; the operation knight of the scene then keeps their parity.",
359
+ "type": "string",
360
+ "enum": [
361
+ "even",
362
+ "odd"
363
+ ]
336
364
  }
337
365
  },
338
366
  "required": [
@@ -341,12 +369,20 @@
341
369
  "unevaluatedProperties": false
342
370
  },
343
371
  "bishop_on": {
344
- "description": "The piece bishop stands on the cell; the scene allows the operation bishop, which keeps the piece.",
372
+ "description": "The piece bishop stands on the cell, after a count of moves of the parity given where one is; the scene allows the operation bishop, which keeps the piece.",
345
373
  "type": "object",
346
374
  "properties": {
347
375
  "cell": {
348
376
  "description": "The cell, not a hole.",
349
377
  "$ref": "#/$defs/cell"
378
+ },
379
+ "after": {
380
+ "description": "Whether the piece has made an even or an odd count of moves; the operation bishop of the scene then keeps their parity.",
381
+ "type": "string",
382
+ "enum": [
383
+ "even",
384
+ "odd"
385
+ ]
350
386
  }
351
387
  },
352
388
  "required": [
@@ -399,7 +435,7 @@
399
435
  "unevaluatedProperties": false
400
436
  },
401
437
  "step_reach": {
402
- "description": "The piece step stands on a cell whose fewest moves from the cell it starts on are at least least and at most most; the key counts those cells. The scene allows the operation step alone, so that its states are the piece's cells.",
438
+ "description": "The piece step stands on a cell whose fewest moves from the cell it starts on are at least least and at most most; the key counts those cells. The scene allows the operation step alone, keeping no parity of its moves, so that its states are the piece's cells.",
403
439
  "type": "object",
404
440
  "properties": {
405
441
  "least": {
@@ -418,7 +454,7 @@
418
454
  "unevaluatedProperties": false
419
455
  },
420
456
  "bishop_reach": {
421
- "description": "The piece bishop stands on a cell whose fewest moves from the cell it starts on are at least least and at most most; the key counts those cells. The scene allows the operation bishop alone, so that its states are the piece's cells.",
457
+ "description": "The piece bishop stands on a cell whose fewest moves from the cell it starts on are at least least and at most most; the key counts those cells. The scene allows the operation bishop alone, keeping no parity of its moves, so that its states are the piece's cells.",
422
458
  "type": "object",
423
459
  "properties": {
424
460
  "least": {
@@ -682,12 +718,12 @@
682
718
  "unevaluatedProperties": false
683
719
  },
684
720
  "polyomino_placings": {
685
- "description": "One figure lies on the sheet; the key counts the places it may lie on, two places one where they cover the same cells. The scene allows the operation polyomino alone, so that its states are the figures.",
721
+ "description": "One figure lies on the sheet; the key counts the places it may lie on, two places one where they cover the same cells. The scene allows the operation polyomino alone with pieces 1, so that its states are the one figure's places.",
686
722
  "type": "object",
687
723
  "unevaluatedProperties": false
688
724
  },
689
725
  "polyomino_shapes": {
690
- "description": "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. The scene allows the operation polyomino alone, so that its states are the figures.",
726
+ "description": "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. The scene allows the operation polyomino alone with pieces 1, so that its states are the one figure's places.",
691
727
  "type": "object",
692
728
  "unevaluatedProperties": false
693
729
  }
@@ -1076,7 +1112,7 @@
1076
1112
  "maxProperties": 1
1077
1113
  },
1078
1114
  "state": {
1079
- "description": "A state: the cells' marks, and a member for each operation of the scene that keeps one.",
1115
+ "description": "A state: the cells' marks, and a member for each operation of the scene that keeps one, with a second beside it where the scene's parameters of the operation ask for it.",
1080
1116
  "type": "object",
1081
1117
  "properties": {
1082
1118
  "marks": {
@@ -1087,14 +1123,38 @@
1087
1123
  "description": "The cell the piece step stands on.",
1088
1124
  "$ref": "#/$defs/cell"
1089
1125
  },
1126
+ "step_parity": {
1127
+ "description": "Whether the piece step has made an even or an odd count of moves; only where the scene's parameters of the piece ask for it.",
1128
+ "type": "string",
1129
+ "enum": [
1130
+ "even",
1131
+ "odd"
1132
+ ]
1133
+ },
1090
1134
  "knight_at": {
1091
1135
  "description": "The cell the piece knight stands on.",
1092
1136
  "$ref": "#/$defs/cell"
1093
1137
  },
1138
+ "knight_parity": {
1139
+ "description": "Whether the piece knight has made an even or an odd count of moves; only where the scene's parameters of the piece ask for it.",
1140
+ "type": "string",
1141
+ "enum": [
1142
+ "even",
1143
+ "odd"
1144
+ ]
1145
+ },
1094
1146
  "bishop_at": {
1095
1147
  "description": "The cell the piece bishop stands on.",
1096
1148
  "$ref": "#/$defs/cell"
1097
1149
  },
1150
+ "bishop_parity": {
1151
+ "description": "Whether the piece bishop has made an even or an odd count of moves; only where the scene's parameters of the piece ask for it.",
1152
+ "type": "string",
1153
+ "enum": [
1154
+ "even",
1155
+ "odd"
1156
+ ]
1157
+ },
1098
1158
  "paper": {
1099
1159
  "description": "The paper: where its cells lie while it is folded, or the cells punched.",
1100
1160
  "type": "object",
@@ -0,0 +1,31 @@
1
+ {
2
+ "description": "A scene the kind refuses: its goal asks for the knight on a cell after an odd count of moves, but the knight's parameters keep no parity of its moves, so no state could tell an odd count from an even one; an author's slip, never a key that the goal cannot be reached.",
3
+ "scene": {
4
+ "sheet": {
5
+ "rows": 8,
6
+ "cols": 8
7
+ },
8
+ "operations": {
9
+ "knight": {
10
+ "cell": "A1"
11
+ }
12
+ },
13
+ "goal": {
14
+ "knight_on": {
15
+ "cell": "A1",
16
+ "after": "odd"
17
+ }
18
+ }
19
+ },
20
+ "seed": "0",
21
+ "sequences": [],
22
+ "proof": {
23
+ "undecided": "invalid",
24
+ "errors": [
25
+ {
26
+ "path": "/goal/knight_on/after",
27
+ "message": "the operation knight keeps no parity of the piece's moves: give it \"parity\": true"
28
+ }
29
+ ]
30
+ }
31
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "The knight of the course's task par-56-d2-2 on A1 of a chessboard. The scene has no goal: each move changes the colour of its cell, so it is back on A1 after an even number of moves only, after 2 already. A move that is no knight's, and a cell off the board, are refused.",
2
+ "description": "The knight of the course's task par-56-d2-2 on A1 of a chessboard, the state keeping whether it has made an even or an odd count of moves; the goal is the knight back on A1 after an odd count. Each move changes the colour of its cell, so it is back on A1 after an even count only, after 2 already, and the goal cannot be met: the whole graph of 64 states is the witness. A move that is no knight's, and a cell off the board, are refused, the parity as it was.",
3
3
  "scene": {
4
4
  "sheet": {
5
5
  "rows": 8,
@@ -7,7 +7,14 @@
7
7
  },
8
8
  "operations": {
9
9
  "knight": {
10
- "cell": "A1"
10
+ "cell": "A1",
11
+ "parity": true
12
+ }
13
+ },
14
+ "goal": {
15
+ "knight_on": {
16
+ "cell": "A1",
17
+ "after": "odd"
11
18
  }
12
19
  }
13
20
  },
@@ -15,7 +22,8 @@
15
22
  "start": {
16
23
  "state": {
17
24
  "marks": {},
18
- "knight_at": "A1"
25
+ "knight_at": "A1",
26
+ "knight_parity": "even"
19
27
  },
20
28
  "goal": false
21
29
  },
@@ -29,7 +37,8 @@
29
37
  },
30
38
  "state": {
31
39
  "marks": {},
32
- "knight_at": "B3"
40
+ "knight_at": "B3",
41
+ "knight_parity": "odd"
33
42
  },
34
43
  "goal": false
35
44
  },
@@ -41,7 +50,8 @@
41
50
  },
42
51
  "state": {
43
52
  "marks": {},
44
- "knight_at": "A1"
53
+ "knight_at": "A1",
54
+ "knight_parity": "even"
45
55
  },
46
56
  "goal": false
47
57
  },
@@ -61,9 +71,54 @@
61
71
  },
62
72
  "refused": "no-cell"
63
73
  }
74
+ ],
75
+ [
76
+ {
77
+ "move": {
78
+ "knight": {
79
+ "to": "C2"
80
+ }
81
+ },
82
+ "state": {
83
+ "marks": {},
84
+ "knight_at": "C2",
85
+ "knight_parity": "odd"
86
+ },
87
+ "goal": false
88
+ },
89
+ {
90
+ "move": {
91
+ "knight": {
92
+ "to": "A3"
93
+ }
94
+ },
95
+ "state": {
96
+ "marks": {},
97
+ "knight_at": "A3",
98
+ "knight_parity": "even"
99
+ },
100
+ "goal": false
101
+ },
102
+ {
103
+ "move": {
104
+ "knight": {
105
+ "to": "B1"
106
+ }
107
+ },
108
+ "state": {
109
+ "marks": {},
110
+ "knight_at": "B1",
111
+ "knight_parity": "odd"
112
+ },
113
+ "goal": false
114
+ }
64
115
  ]
65
116
  ],
66
117
  "proof": {
67
- "undecided": "no-goal"
118
+ "key": "unreachable",
119
+ "witness": {
120
+ "layers": [1, 2, 9, 20, 21, 10, 1]
121
+ },
122
+ "ends": []
68
123
  }
69
124
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Lines drawn on the open sheet move with the part laid over: a strip of 1 by 6 with the lines v4 and v5 drawn. Its right part folded over along v4 lays v5 along v3, where the paper then folds, and the punch at A3 goes through the 4 layers there, the most holes, the key; folded the other way round the strip takes 3 layers at most. A line on the paper that no drawn line lies along is refused, and so is v5 once it lies elsewhere, off the paper.",
2
+ "description": "Lines drawn on the open sheet move with the part laid over: a strip of 1 by 6 with the lines v4 and v5 drawn. Its right part folded over along v4 lays v5 along v3, where the paper then folds, and the punch at A3 goes through the 4 layers there, the most holes, the key; folded the other way round the strip takes 3 layers at most. A line on the paper that no drawn line lies along is refused, and so is v5 once it lies elsewhere, off the paper. A fold is refused by its parts in turn: v1, not drawn, though laying its right part over would lay the wider one; then a side not the line's; then the wider part laid over.",
3
3
  "scene": {
4
4
  "sheet": {
5
5
  "rows": 1,
@@ -105,6 +105,41 @@
105
105
  },
106
106
  "goal": true
107
107
  }
108
+ ],
109
+ [
110
+ {
111
+ "move": {
112
+ "paper": {
113
+ "fold": {
114
+ "line": "v1",
115
+ "lay": "right"
116
+ }
117
+ }
118
+ },
119
+ "refused": "not-given"
120
+ },
121
+ {
122
+ "move": {
123
+ "paper": {
124
+ "fold": {
125
+ "line": "v4",
126
+ "lay": "top"
127
+ }
128
+ }
129
+ },
130
+ "refused": "no-side"
131
+ },
132
+ {
133
+ "move": {
134
+ "paper": {
135
+ "fold": {
136
+ "line": "v5",
137
+ "lay": "left"
138
+ }
139
+ }
140
+ },
141
+ "refused": "overhang"
142
+ }
108
143
  ]
109
144
  ],
110
145
  "proof": {
@@ -0,0 +1,28 @@
1
+ {
2
+ "description": "A count of one figure's places on a scene that lets more than one figure lie at once: dominoes on 4 by 4 with no pieces given. The goal counts one figure, so the kind names the goal and asks for pieces 1, rather than build states of two figures that it never counts.",
3
+ "scene": {
4
+ "sheet": {
5
+ "rows": 4,
6
+ "cols": 4
7
+ },
8
+ "operations": {
9
+ "polyomino": {
10
+ "shapes": [["A1", "A2"]]
11
+ }
12
+ },
13
+ "goal": {
14
+ "polyomino_placings": {}
15
+ }
16
+ },
17
+ "seed": "0",
18
+ "sequences": [],
19
+ "proof": {
20
+ "undecided": "invalid",
21
+ "errors": [
22
+ {
23
+ "path": "/goal/polyomino_placings",
24
+ "message": "a count of one figure takes pieces 1 of the operation polyomino, so that no second figure lies at once"
25
+ }
26
+ ]
27
+ }
28
+ }
@@ -0,0 +1,195 @@
1
+ {
2
+ "handles": [
3
+ {
4
+ "name": "highlight",
5
+ "description": "Highlight parts of the widget, by the IDs its parts carry, so that the learner looks there. A highlight stays until clear, until your next reply, or until its part changes.",
6
+ "inputSchema": {
7
+ "description": "The parts to highlight.",
8
+ "type": "object",
9
+ "properties": {
10
+ "parts": {
11
+ "description": "The IDs of the parts, as the widget's parts give them.",
12
+ "type": "array",
13
+ "items": {
14
+ "description": "A part's ID.",
15
+ "type": "string",
16
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$"
17
+ },
18
+ "minItems": 1,
19
+ "uniqueItems": true
20
+ }
21
+ },
22
+ "required": ["parts"],
23
+ "unevaluatedProperties": false
24
+ },
25
+ "class": "show"
26
+ },
27
+ {
28
+ "name": "camera",
29
+ "description": "Turn the widget's camera to frame the parts named, by their IDs, or the whole widget where none are named. The state does not change.",
30
+ "inputSchema": {
31
+ "description": "The parts to frame; none for the whole widget.",
32
+ "type": "object",
33
+ "properties": {
34
+ "parts": {
35
+ "description": "The IDs of the parts, as the widget's parts give them.",
36
+ "type": "array",
37
+ "items": {
38
+ "description": "A part's ID.",
39
+ "type": "string",
40
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$"
41
+ },
42
+ "minItems": 1,
43
+ "uniqueItems": true
44
+ }
45
+ },
46
+ "unevaluatedProperties": false
47
+ },
48
+ "class": "show"
49
+ },
50
+ {
51
+ "name": "clear",
52
+ "description": "Take away every highlight and showing your calls laid on the widget. The state does not change.",
53
+ "inputSchema": {
54
+ "description": "No arguments.",
55
+ "type": "object",
56
+ "unevaluatedProperties": false
57
+ },
58
+ "class": "show"
59
+ },
60
+ {
61
+ "name": "undo",
62
+ "description": "Bring back the widget's state from before its last change: the learner's last move, an earlier call of this reply, or the whole of an earlier reply of yours. Refused where there is no change to undo.",
63
+ "inputSchema": {
64
+ "description": "No arguments.",
65
+ "type": "object",
66
+ "unevaluatedProperties": false
67
+ },
68
+ "class": "rewind"
69
+ },
70
+ {
71
+ "name": "reset",
72
+ "description": "Lay again the state the widget started from: the scene's own, or in a lesson the view of the step shown. The learner can undo it.",
73
+ "inputSchema": {
74
+ "description": "No arguments.",
75
+ "type": "object",
76
+ "unevaluatedProperties": false
77
+ },
78
+ "class": "rewind"
79
+ },
80
+ {
81
+ "name": "post",
82
+ "description": "Put a post on a place of the line, as the learner would by a tap: a tree in a row, a lamp, a stop. Only where the scene allows posts; refused where a post stands there already, or where the line has no such place. The learner can undo it.",
83
+ "inputSchema": {
84
+ "description": "The place to put a post on.",
85
+ "type": "object",
86
+ "properties": {
87
+ "at": {
88
+ "description": "The place, by its number, as the line numbers its places from its first number on.",
89
+ "type": "integer",
90
+ "minimum": 0,
91
+ "maximum": 10000
92
+ }
93
+ },
94
+ "required": ["at"],
95
+ "unevaluatedProperties": false
96
+ },
97
+ "class": "solve"
98
+ },
99
+ {
100
+ "name": "cut",
101
+ "description": "Cut the line at a place, as a saw cuts a log or scissors a ribbon, as the learner would by a stroke across it. Only where the scene allows cuts; refused at an end of an open line, where it is cut already, or where the line has no such place. On an open line each cut adds a piece; on a ring the first cut opens it and leaves one piece. The learner can undo it.",
102
+ "inputSchema": {
103
+ "description": "The place to cut at.",
104
+ "type": "object",
105
+ "properties": {
106
+ "at": {
107
+ "description": "The place, by its number, as the line numbers its places from its first number on.",
108
+ "type": "integer",
109
+ "minimum": 0,
110
+ "maximum": 10000
111
+ }
112
+ },
113
+ "required": ["at"],
114
+ "unevaluatedProperties": false
115
+ },
116
+ "class": "solve"
117
+ },
118
+ {
119
+ "name": "jump",
120
+ "description": "Make the jumper jump its step of places, as the learner would by a jump's button: forward, towards greater numbers, up on an upright line, or back where the scene allows it; round a ring past its last place. Only where the scene has a jumper; refused where the jump would land off an open line, or back where the scene allows none. The learner can undo it.",
121
+ "inputSchema": {
122
+ "description": "Which way to jump.",
123
+ "type": "object",
124
+ "properties": {
125
+ "direction": {
126
+ "description": "\"forward\", towards greater numbers, or \"back\", towards smaller ones.",
127
+ "type": "string",
128
+ "enum": ["forward", "back"]
129
+ }
130
+ },
131
+ "required": ["direction"],
132
+ "unevaluatedProperties": false
133
+ },
134
+ "class": "solve"
135
+ },
136
+ {
137
+ "name": "show_best_path",
138
+ "description": "Show on the line the solver's best path from the state now to the goal — on a maximum or a minimum, to its best —: the places each move acts on, numbered in turn, a jump's on the place it lands on, and the jump's button. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
139
+ "inputSchema": {
140
+ "description": "No arguments.",
141
+ "type": "object",
142
+ "unevaluatedProperties": false
143
+ },
144
+ "class": "solve"
145
+ },
146
+ {
147
+ "name": "show_outcomes",
148
+ "description": "Mark on the line each move the learner can make now by what it does to the fewest moves left to the goal, as the best path leads: closer, as far, farther, or where the goal — on a maximum or a minimum, its best — can no longer be reached; a post's or a cut's on its place, a jump's on the place it lands on and on its button; a place that several moves act on shows the best of their outcomes, though a tap there puts a post first. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
149
+ "inputSchema": {
150
+ "description": "No arguments.",
151
+ "type": "object",
152
+ "unevaluatedProperties": false
153
+ },
154
+ "class": "solve"
155
+ },
156
+ {
157
+ "name": "show_distance",
158
+ "description": "Say in the widget's bar the fewest moves left from the state now to the goal, as the best path leads, or that it can no longer be reached; on a maximum or a minimum whose best can no longer be reached, that the goal is met, or can still be met, short of its best. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
159
+ "inputSchema": {
160
+ "description": "No arguments.",
161
+ "type": "object",
162
+ "unevaluatedProperties": false
163
+ },
164
+ "class": "solve"
165
+ },
166
+ {
167
+ "name": "show_graph",
168
+ "description": "Say in the widget's bar how many states each count of moves from the scene's start reaches, the layer of the state now marked. It stays while the state is this one, until clear or your next reply. Refused where the scene has no goal.",
169
+ "inputSchema": {
170
+ "description": "No arguments.",
171
+ "type": "object",
172
+ "unevaluatedProperties": false
173
+ },
174
+ "class": "solve"
175
+ },
176
+ {
177
+ "name": "show_count",
178
+ "description": "Number the posts, or the gaps between neighbouring posts, one by one along the line from 1, on a ring the gap round past the last post last, so that the learner counts them with you: they are what the widget's counters of posts and gaps count, and an open line has one gap fewer than posts, a ring as many. The numbers follow the posts as they change and stay until clear or your next reply. The state does not change.",
179
+ "inputSchema": {
180
+ "description": "What to count.",
181
+ "type": "object",
182
+ "properties": {
183
+ "of": {
184
+ "description": "The posts, \"posts\", or the gaps between neighbouring posts, \"gaps\".",
185
+ "type": "string",
186
+ "enum": ["posts", "gaps"]
187
+ }
188
+ },
189
+ "required": ["of"],
190
+ "unevaluatedProperties": false
191
+ },
192
+ "class": "show"
193
+ }
194
+ ]
195
+ }