@altnovatrail/widgets 0.2.0 → 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.
- package/README.md +1 -1
- package/kinds/line/line.handles.json +195 -0
- package/kinds/line/line.schema.json +321 -0
- package/kinds/line/vectors/cases.json +213 -0
- package/kinds/line/vectors/gaps-12-d1-1.json +140 -0
- package/kinds/line/vectors/gaps-12-d1-2.json +95 -0
- package/kinds/line/vectors/gaps-12-d1-3.json +122 -0
- package/kinds/line/vectors/gaps-12-d1-4.json +121 -0
- package/kinds/line/vectors/gaps-12-d1-5.json +87 -0
- package/kinds/line/vectors/gaps-12-d2-1.json +173 -0
- package/kinds/line/vectors/gaps-12-d2-6.json +87 -0
- package/kinds/line/vectors/gaps-12-d3-2.json +173 -0
- package/kinds/line/vectors/gaps-12-d4-4.json +168 -0
- package/kinds/line/vectors/gaps-12-d5-3.json +99 -0
- package/kinds/line/vectors/gaps-12-d5-4.json +215 -0
- package/kinds/line/vectors/gaps-34-d1-1.json +37 -0
- package/kinds/line/vectors/gaps-34-d1-2.json +130 -0
- package/kinds/line/vectors/gaps-34-d1-4.json +155 -0
- package/kinds/line/vectors/gaps-34-d1-5.json +43 -0
- package/kinds/line/vectors/gaps-34-d3-2.json +38 -0
- package/kinds/line/vectors/gaps-34-d3-5.json +177 -0
- package/kinds/line/vectors/gaps-34-d5-3.json +39 -0
- package/kinds/line/vectors/invalid-line.json +34 -0
- package/kinds/line/vectors/invalid-ring.json +34 -0
- package/kinds/line/vectors/invalid.json +43 -0
- package/kinds/line/vectors/jump-unreachable.json +104 -0
- package/kinds/line/vectors/limit.json +40 -0
- package/kinds/line/vectors/op-not-in-scene.json +47 -0
- package/kinds/line/vectors/ring-cut.json +104 -0
- package/kinds/line/vectors/ring-every.json +107 -0
- package/kinds/line/vectors/ring-jump.json +135 -0
- package/lib/cores/arith.d.ts +62 -0
- package/lib/cores/arith.js +197 -0
- package/lib/cores/kind.d.ts +10 -0
- package/lib/cores/registry.d.ts +43 -0
- package/lib/cores/registry.js +87 -0
- package/lib/cores/search.js +36 -8
- package/lib/kinds/cells/kind.js +11 -64
- package/lib/kinds/cells/operation.d.ts +6 -0
- package/lib/kinds/cells/polyomino.d.ts +14 -0
- package/lib/kinds/cells/polyomino.js +100 -24
- package/lib/kinds/line/cut.d.ts +2 -0
- package/lib/kinds/line/cut.js +63 -0
- package/lib/kinds/line/goals.d.ts +22 -0
- package/lib/kinds/line/goals.js +137 -0
- package/lib/kinds/line/index.d.ts +13 -0
- package/lib/kinds/line/index.js +17 -0
- package/lib/kinds/line/jump.d.ts +10 -0
- package/lib/kinds/line/jump.js +95 -0
- package/lib/kinds/line/kind.d.ts +25 -0
- package/lib/kinds/line/kind.js +125 -0
- package/lib/kinds/line/line.d.ts +63 -0
- package/lib/kinds/line/line.js +157 -0
- package/lib/kinds/line/operation.d.ts +69 -0
- package/lib/kinds/line/operation.js +1 -0
- package/lib/kinds/line/posts.d.ts +11 -0
- package/lib/kinds/line/posts.js +85 -0
- package/lib/kinds/line/registry.d.ts +2 -0
- package/lib/kinds/line/registry.js +11 -0
- package/lib/kinds/line/schema.d.ts +4 -0
- package/lib/kinds/line/schema.js +157 -0
- 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
|
|
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).
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://altnovatrail.github.io/widgets/kinds/line/1.2/line.schema.json",
|
|
4
|
+
"title": "A scene of the widget kind line",
|
|
5
|
+
"description": "A line of places, 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
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"line": {
|
|
9
|
+
"description": "The line as the scene gives it.",
|
|
10
|
+
"$ref": "#/$defs/line",
|
|
11
|
+
"unevaluatedProperties": false
|
|
12
|
+
},
|
|
13
|
+
"operations": {
|
|
14
|
+
"description": "The operations a learner may play on the scene, each by its name with its parameters; none, for a line only to look at.",
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"post": {
|
|
18
|
+
"description": "Put a post on any free place of the line; no parameters.",
|
|
19
|
+
"type": "object",
|
|
20
|
+
"unevaluatedProperties": false
|
|
21
|
+
},
|
|
22
|
+
"cut": {
|
|
23
|
+
"description": "Cut the line, a log or a ribbon from its first place to its last, at any inner place, or a ring at any place; no parameters.",
|
|
24
|
+
"type": "object",
|
|
25
|
+
"unevaluatedProperties": false
|
|
26
|
+
},
|
|
27
|
+
"jump": {
|
|
28
|
+
"description": "A jumper that starts on a place and jumps a step of places at a time, forward and, where the scene allows it, back, never off an open line and round a ring.",
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"from": {
|
|
32
|
+
"description": "The place it starts on, by its number.",
|
|
33
|
+
"$ref": "#/$defs/place"
|
|
34
|
+
},
|
|
35
|
+
"step": {
|
|
36
|
+
"description": "The places one jump spans, fewer than the line's places.",
|
|
37
|
+
"type": "integer",
|
|
38
|
+
"minimum": 1,
|
|
39
|
+
"maximum": 100
|
|
40
|
+
},
|
|
41
|
+
"back": {
|
|
42
|
+
"description": "Whether it may jump back, towards smaller numbers, too; false where left out.",
|
|
43
|
+
"type": "boolean"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": [
|
|
47
|
+
"from",
|
|
48
|
+
"step"
|
|
49
|
+
],
|
|
50
|
+
"unevaluatedProperties": false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"unevaluatedProperties": false
|
|
54
|
+
},
|
|
55
|
+
"goal": {
|
|
56
|
+
"description": "What a state is to meet, one goal by its name with its parameters.",
|
|
57
|
+
"type": "object",
|
|
58
|
+
"properties": {
|
|
59
|
+
"counters": {
|
|
60
|
+
"description": "A state whose counters have the values given; the key is the fewest moves to one, or, where max or min names a counter, its greatest or least value over such states. At least one of is, max and min; never both max and min.",
|
|
61
|
+
"type": "object",
|
|
62
|
+
"properties": {
|
|
63
|
+
"is": {
|
|
64
|
+
"description": "The counters, each by its name, with the value it is to have.",
|
|
65
|
+
"type": "object",
|
|
66
|
+
"propertyNames": {
|
|
67
|
+
"$ref": "#/$defs/counter"
|
|
68
|
+
},
|
|
69
|
+
"additionalProperties": {
|
|
70
|
+
"description": "The value the counter is to have.",
|
|
71
|
+
"type": "integer",
|
|
72
|
+
"minimum": 0,
|
|
73
|
+
"maximum": 1000000000
|
|
74
|
+
},
|
|
75
|
+
"minProperties": 1
|
|
76
|
+
},
|
|
77
|
+
"max": {
|
|
78
|
+
"description": "The counter whose greatest value the key is.",
|
|
79
|
+
"$ref": "#/$defs/counter"
|
|
80
|
+
},
|
|
81
|
+
"min": {
|
|
82
|
+
"description": "The counter whose least value the key is.",
|
|
83
|
+
"$ref": "#/$defs/counter"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"minProperties": 1,
|
|
87
|
+
"not": {
|
|
88
|
+
"properties": {
|
|
89
|
+
"max": {
|
|
90
|
+
"description": "Max, never beside min."
|
|
91
|
+
},
|
|
92
|
+
"min": {
|
|
93
|
+
"description": "Min, never beside max."
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"required": [
|
|
97
|
+
"max",
|
|
98
|
+
"min"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"unevaluatedProperties": false
|
|
102
|
+
},
|
|
103
|
+
"every": {
|
|
104
|
+
"description": "A post on every place from one to another, both included; the whole line where neither is given.",
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"from": {
|
|
108
|
+
"description": "The first place of the stretch; the line's first where left out.",
|
|
109
|
+
"$ref": "#/$defs/place"
|
|
110
|
+
},
|
|
111
|
+
"to": {
|
|
112
|
+
"description": "The last place of the stretch, never before from on an open line, and on a ring past the last place round to it where before from; the line's last where left out.",
|
|
113
|
+
"$ref": "#/$defs/place"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"unevaluatedProperties": false
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"minProperties": 1,
|
|
120
|
+
"maxProperties": 1,
|
|
121
|
+
"unevaluatedProperties": false
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"required": [
|
|
125
|
+
"line",
|
|
126
|
+
"operations"
|
|
127
|
+
],
|
|
128
|
+
"unevaluatedProperties": false,
|
|
129
|
+
"$defs": {
|
|
130
|
+
"place": {
|
|
131
|
+
"description": "A place of the line by its number: the line's first number for its first place, and each next place the next number.",
|
|
132
|
+
"type": "integer",
|
|
133
|
+
"minimum": 0,
|
|
134
|
+
"maximum": 10000
|
|
135
|
+
},
|
|
136
|
+
"counter": {
|
|
137
|
+
"description": "A counter, a number of a state the widget shows, by its name: posts: The posts on the line. gaps: The gaps between neighbouring posts: on an open line one fewer than the posts, on a ring as many as the posts, a lone post's gap the way round from it back to it; none where there is no post. length: The gaps' lengths together, each its count of places times the spacing: on an open line from the first post to the last, 0 where there are fewer than two posts; on a ring the whole way round where there is a post, 0 where there is none. cuts, where the scene allows cut: The cuts made. pieces, where the scene allows cut: The pieces the cuts leave: on an open line one more than the cuts; on a ring as many as the cuts, and one where there is none. at, where the scene allows jump: The number of the place the jumper stands on. distance, where the scene allows jump: The length from the jumper's start to where it stands, their count of places apart times the spacing; on a ring, the shorter way round.",
|
|
138
|
+
"enum": [
|
|
139
|
+
"posts",
|
|
140
|
+
"gaps",
|
|
141
|
+
"length",
|
|
142
|
+
"cuts",
|
|
143
|
+
"pieces",
|
|
144
|
+
"at",
|
|
145
|
+
"distance"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"line": {
|
|
149
|
+
"description": "Places in a row, numbered from the first number on, each a spacing from the next, open or closed into a ring, and the posts that stand on them at the start.",
|
|
150
|
+
"type": "object",
|
|
151
|
+
"properties": {
|
|
152
|
+
"places": {
|
|
153
|
+
"description": "The count of places.",
|
|
154
|
+
"type": "integer",
|
|
155
|
+
"minimum": 2,
|
|
156
|
+
"maximum": 101
|
|
157
|
+
},
|
|
158
|
+
"first": {
|
|
159
|
+
"description": "The number of the first place, as the statement numbers it — a floor, a page, a post —, so that the last place's number is at most the greatest a place has; 0 where left out.",
|
|
160
|
+
"type": "integer",
|
|
161
|
+
"minimum": 0,
|
|
162
|
+
"maximum": 10000
|
|
163
|
+
},
|
|
164
|
+
"spacing": {
|
|
165
|
+
"description": "The length from a place to the next, in the statement's unit — metres, steps, minutes; 1 where left out.",
|
|
166
|
+
"type": "integer",
|
|
167
|
+
"minimum": 1,
|
|
168
|
+
"maximum": 10000
|
|
169
|
+
},
|
|
170
|
+
"vertical": {
|
|
171
|
+
"description": "Whether the line is drawn upright, its first place at the bottom, as floors, stairs or a well; it changes no rule, and a ring is never upright. False where left out.",
|
|
172
|
+
"type": "boolean"
|
|
173
|
+
},
|
|
174
|
+
"closed": {
|
|
175
|
+
"description": "Whether the line is closed into a ring, its last place next to its first, as bushes round a flowerbed or a fence round a garden: as many gaps as posts, no end to cut at, and a jumper going on round it. False where left out.",
|
|
176
|
+
"type": "boolean"
|
|
177
|
+
},
|
|
178
|
+
"sides": {
|
|
179
|
+
"description": "A ring's sides, where it is drawn as a figure with corners, as a square flowerbed or a garden's fence: each side by its count of gaps, the first place a corner and each next corner a side on, the sides' gaps together the ring's places. A round ring where left out; it changes no rule.",
|
|
180
|
+
"type": "array",
|
|
181
|
+
"items": {
|
|
182
|
+
"description": "A side's count of gaps.",
|
|
183
|
+
"type": "integer",
|
|
184
|
+
"minimum": 1,
|
|
185
|
+
"maximum": 100
|
|
186
|
+
},
|
|
187
|
+
"minItems": 3,
|
|
188
|
+
"maxItems": 101
|
|
189
|
+
},
|
|
190
|
+
"posts": {
|
|
191
|
+
"description": "The places a post stands on at the scene's start, each once.",
|
|
192
|
+
"type": "array",
|
|
193
|
+
"items": {
|
|
194
|
+
"description": "A place, by its number.",
|
|
195
|
+
"$ref": "#/$defs/place"
|
|
196
|
+
},
|
|
197
|
+
"uniqueItems": true
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"required": [
|
|
201
|
+
"places"
|
|
202
|
+
],
|
|
203
|
+
"dependentRequired": {
|
|
204
|
+
"sides": [
|
|
205
|
+
"closed"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"allOf": [
|
|
209
|
+
{
|
|
210
|
+
"not": {
|
|
211
|
+
"properties": {
|
|
212
|
+
"closed": {
|
|
213
|
+
"description": "A ring.",
|
|
214
|
+
"const": true
|
|
215
|
+
},
|
|
216
|
+
"vertical": {
|
|
217
|
+
"description": "Upright.",
|
|
218
|
+
"const": true
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"required": [
|
|
222
|
+
"closed",
|
|
223
|
+
"vertical"
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"not": {
|
|
229
|
+
"properties": {
|
|
230
|
+
"closed": {
|
|
231
|
+
"description": "An open line.",
|
|
232
|
+
"const": false
|
|
233
|
+
},
|
|
234
|
+
"sides": {
|
|
235
|
+
"description": "Sides given."
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"required": [
|
|
239
|
+
"closed",
|
|
240
|
+
"sides"
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
"move": {
|
|
247
|
+
"description": "A move: one member, named by the operation it plays, holding what a move of the operation holds.",
|
|
248
|
+
"type": "object",
|
|
249
|
+
"properties": {
|
|
250
|
+
"post": {
|
|
251
|
+
"description": "Put a post on a place.",
|
|
252
|
+
"type": "object",
|
|
253
|
+
"properties": {
|
|
254
|
+
"at": {
|
|
255
|
+
"description": "The place, by its number.",
|
|
256
|
+
"$ref": "#/$defs/place"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"required": [
|
|
260
|
+
"at"
|
|
261
|
+
],
|
|
262
|
+
"unevaluatedProperties": false
|
|
263
|
+
},
|
|
264
|
+
"cut": {
|
|
265
|
+
"description": "Cut at a place: never at an end of an open line.",
|
|
266
|
+
"type": "object",
|
|
267
|
+
"properties": {
|
|
268
|
+
"at": {
|
|
269
|
+
"description": "The place, by its number.",
|
|
270
|
+
"$ref": "#/$defs/place"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"required": [
|
|
274
|
+
"at"
|
|
275
|
+
],
|
|
276
|
+
"unevaluatedProperties": false
|
|
277
|
+
},
|
|
278
|
+
"jump": {
|
|
279
|
+
"description": "A jump: forward, towards greater numbers, or back.",
|
|
280
|
+
"enum": [
|
|
281
|
+
"forward",
|
|
282
|
+
"back"
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"minProperties": 1,
|
|
287
|
+
"maxProperties": 1
|
|
288
|
+
},
|
|
289
|
+
"state": {
|
|
290
|
+
"description": "A state: the posts, and a member for each operation of the scene that keeps one.",
|
|
291
|
+
"type": "object",
|
|
292
|
+
"properties": {
|
|
293
|
+
"posts": {
|
|
294
|
+
"description": "The places a post stands on now, by their numbers, in ascending order.",
|
|
295
|
+
"type": "array",
|
|
296
|
+
"items": {
|
|
297
|
+
"description": "A place, by its number.",
|
|
298
|
+
"$ref": "#/$defs/place"
|
|
299
|
+
},
|
|
300
|
+
"uniqueItems": true
|
|
301
|
+
},
|
|
302
|
+
"cuts": {
|
|
303
|
+
"description": "The places cut, by their numbers, in ascending order.",
|
|
304
|
+
"type": "array",
|
|
305
|
+
"items": {
|
|
306
|
+
"description": "A place cut.",
|
|
307
|
+
"$ref": "#/$defs/place"
|
|
308
|
+
},
|
|
309
|
+
"uniqueItems": true
|
|
310
|
+
},
|
|
311
|
+
"at": {
|
|
312
|
+
"description": "The place the jumper stands on.",
|
|
313
|
+
"$ref": "#/$defs/place"
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
"required": [
|
|
317
|
+
"posts"
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|