@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.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/kinds/line/line.handles.json +195 -0
  3. package/kinds/line/line.schema.json +321 -0
  4. package/kinds/line/vectors/cases.json +213 -0
  5. package/kinds/line/vectors/gaps-12-d1-1.json +140 -0
  6. package/kinds/line/vectors/gaps-12-d1-2.json +95 -0
  7. package/kinds/line/vectors/gaps-12-d1-3.json +122 -0
  8. package/kinds/line/vectors/gaps-12-d1-4.json +121 -0
  9. package/kinds/line/vectors/gaps-12-d1-5.json +87 -0
  10. package/kinds/line/vectors/gaps-12-d2-1.json +173 -0
  11. package/kinds/line/vectors/gaps-12-d2-6.json +87 -0
  12. package/kinds/line/vectors/gaps-12-d3-2.json +173 -0
  13. package/kinds/line/vectors/gaps-12-d4-4.json +168 -0
  14. package/kinds/line/vectors/gaps-12-d5-3.json +99 -0
  15. package/kinds/line/vectors/gaps-12-d5-4.json +215 -0
  16. package/kinds/line/vectors/gaps-34-d1-1.json +37 -0
  17. package/kinds/line/vectors/gaps-34-d1-2.json +130 -0
  18. package/kinds/line/vectors/gaps-34-d1-4.json +155 -0
  19. package/kinds/line/vectors/gaps-34-d1-5.json +43 -0
  20. package/kinds/line/vectors/gaps-34-d3-2.json +38 -0
  21. package/kinds/line/vectors/gaps-34-d3-5.json +177 -0
  22. package/kinds/line/vectors/gaps-34-d5-3.json +39 -0
  23. package/kinds/line/vectors/invalid-line.json +34 -0
  24. package/kinds/line/vectors/invalid-ring.json +34 -0
  25. package/kinds/line/vectors/invalid.json +43 -0
  26. package/kinds/line/vectors/jump-unreachable.json +104 -0
  27. package/kinds/line/vectors/limit.json +40 -0
  28. package/kinds/line/vectors/op-not-in-scene.json +47 -0
  29. package/kinds/line/vectors/ring-cut.json +104 -0
  30. package/kinds/line/vectors/ring-every.json +107 -0
  31. package/kinds/line/vectors/ring-jump.json +135 -0
  32. package/lib/cores/arith.d.ts +62 -0
  33. package/lib/cores/arith.js +197 -0
  34. package/lib/cores/kind.d.ts +10 -0
  35. package/lib/cores/registry.d.ts +43 -0
  36. package/lib/cores/registry.js +87 -0
  37. package/lib/cores/search.js +36 -8
  38. package/lib/kinds/cells/kind.js +11 -64
  39. package/lib/kinds/cells/operation.d.ts +6 -0
  40. package/lib/kinds/cells/polyomino.d.ts +14 -0
  41. package/lib/kinds/cells/polyomino.js +100 -24
  42. package/lib/kinds/line/cut.d.ts +2 -0
  43. package/lib/kinds/line/cut.js +63 -0
  44. package/lib/kinds/line/goals.d.ts +22 -0
  45. package/lib/kinds/line/goals.js +137 -0
  46. package/lib/kinds/line/index.d.ts +13 -0
  47. package/lib/kinds/line/index.js +17 -0
  48. package/lib/kinds/line/jump.d.ts +10 -0
  49. package/lib/kinds/line/jump.js +95 -0
  50. package/lib/kinds/line/kind.d.ts +25 -0
  51. package/lib/kinds/line/kind.js +125 -0
  52. package/lib/kinds/line/line.d.ts +63 -0
  53. package/lib/kinds/line/line.js +157 -0
  54. package/lib/kinds/line/operation.d.ts +69 -0
  55. package/lib/kinds/line/operation.js +1 -0
  56. package/lib/kinds/line/posts.d.ts +11 -0
  57. package/lib/kinds/line/posts.js +85 -0
  58. package/lib/kinds/line/registry.d.ts +2 -0
  59. package/lib/kinds/line/registry.js +11 -0
  60. package/lib/kinds/line/schema.d.ts +4 -0
  61. package/lib/kinds/line/schema.js +157 -0
  62. package/package.json +9 -2
@@ -0,0 +1,177 @@
1
+ {
2
+ "description": "The task gaps-34-d3-5: a boy on the first of 21 slabs jumps along the path, always skipping one slab; how many jumps to the last slab? The fewest jumps of two places, 10: the jumper takes a line too long for posts.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 21,
6
+ "first": 1
7
+ },
8
+ "operations": {
9
+ "jump": {
10
+ "from": 1,
11
+ "step": 2
12
+ }
13
+ },
14
+ "goal": {
15
+ "counters": {
16
+ "is": {
17
+ "at": 21
18
+ }
19
+ }
20
+ }
21
+ },
22
+ "seed": "0",
23
+ "start": {
24
+ "state": {
25
+ "posts": [],
26
+ "at": 1
27
+ },
28
+ "goal": false
29
+ },
30
+ "sequences": [
31
+ [
32
+ {
33
+ "move": {
34
+ "jump": "forward"
35
+ },
36
+ "state": {
37
+ "posts": [],
38
+ "at": 3
39
+ },
40
+ "goal": false
41
+ },
42
+ {
43
+ "move": {
44
+ "jump": "forward"
45
+ },
46
+ "state": {
47
+ "posts": [],
48
+ "at": 5
49
+ },
50
+ "goal": false
51
+ },
52
+ {
53
+ "move": {
54
+ "jump": "forward"
55
+ },
56
+ "state": {
57
+ "posts": [],
58
+ "at": 7
59
+ },
60
+ "goal": false
61
+ },
62
+ {
63
+ "move": {
64
+ "jump": "forward"
65
+ },
66
+ "state": {
67
+ "posts": [],
68
+ "at": 9
69
+ },
70
+ "goal": false
71
+ },
72
+ {
73
+ "move": {
74
+ "jump": "forward"
75
+ },
76
+ "state": {
77
+ "posts": [],
78
+ "at": 11
79
+ },
80
+ "goal": false
81
+ },
82
+ {
83
+ "move": {
84
+ "jump": "forward"
85
+ },
86
+ "state": {
87
+ "posts": [],
88
+ "at": 13
89
+ },
90
+ "goal": false
91
+ },
92
+ {
93
+ "move": {
94
+ "jump": "forward"
95
+ },
96
+ "state": {
97
+ "posts": [],
98
+ "at": 15
99
+ },
100
+ "goal": false
101
+ },
102
+ {
103
+ "move": {
104
+ "jump": "forward"
105
+ },
106
+ "state": {
107
+ "posts": [],
108
+ "at": 17
109
+ },
110
+ "goal": false
111
+ },
112
+ {
113
+ "move": {
114
+ "jump": "forward"
115
+ },
116
+ "state": {
117
+ "posts": [],
118
+ "at": 19
119
+ },
120
+ "goal": false
121
+ },
122
+ {
123
+ "move": {
124
+ "jump": "forward"
125
+ },
126
+ "state": {
127
+ "posts": [],
128
+ "at": 21
129
+ },
130
+ "goal": true
131
+ }
132
+ ]
133
+ ],
134
+ "proof": {
135
+ "key": 10,
136
+ "witness": {
137
+ "path": [
138
+ {
139
+ "jump": "forward"
140
+ },
141
+ {
142
+ "jump": "forward"
143
+ },
144
+ {
145
+ "jump": "forward"
146
+ },
147
+ {
148
+ "jump": "forward"
149
+ },
150
+ {
151
+ "jump": "forward"
152
+ },
153
+ {
154
+ "jump": "forward"
155
+ },
156
+ {
157
+ "jump": "forward"
158
+ },
159
+ {
160
+ "jump": "forward"
161
+ },
162
+ {
163
+ "jump": "forward"
164
+ },
165
+ {
166
+ "jump": "forward"
167
+ }
168
+ ]
169
+ },
170
+ "ends": [
171
+ {
172
+ "posts": [],
173
+ "at": 21
174
+ }
175
+ ]
176
+ }
177
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "description": "The task gaps-34-d5-3: a square garden of sides of 20 metres, a post every 4 metres and one in every corner; how many posts? A square ring only to look at, four sides of five gaps 4 metres each, a post on each of its 20 places, and the key is its posts, 20: as many as its gaps, its length round 80 metres.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 20,
6
+ "first": 1,
7
+ "spacing": 4,
8
+ "closed": true,
9
+ "sides": [5, 5, 5, 5],
10
+ "posts": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
11
+ },
12
+ "operations": {},
13
+ "goal": {
14
+ "counters": {
15
+ "max": "posts"
16
+ }
17
+ }
18
+ },
19
+ "seed": "0",
20
+ "start": {
21
+ "state": {
22
+ "posts": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
23
+ },
24
+ "goal": true
25
+ },
26
+ "sequences": [],
27
+ "proof": {
28
+ "key": 20,
29
+ "asks": "max",
30
+ "witness": {
31
+ "path": []
32
+ },
33
+ "ends": [
34
+ {
35
+ "posts": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
36
+ }
37
+ ]
38
+ }
39
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "description": "A line whose posts name a place twice and a place off the line: the line is refused, and the goal, which reads the line, is not read at all.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 5,
6
+ "first": 1,
7
+ "posts": [2, 2, 6]
8
+ },
9
+ "operations": {
10
+ "post": {}
11
+ },
12
+ "goal": {
13
+ "every": {
14
+ "from": 3,
15
+ "to": 2
16
+ }
17
+ }
18
+ },
19
+ "seed": "0",
20
+ "sequences": [],
21
+ "proof": {
22
+ "undecided": "invalid",
23
+ "errors": [
24
+ {
25
+ "path": "/line/posts/1",
26
+ "message": "a place named twice"
27
+ },
28
+ {
29
+ "path": "/line/posts/2",
30
+ "message": "a place of the line, a whole number from 1 to 5"
31
+ }
32
+ ]
33
+ }
34
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "description": "Rings the kind refuses: one drawn upright, and sides whose gaps together are not the ring's places; the goal, which reads the line, is not read at all.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 6,
6
+ "closed": true,
7
+ "vertical": true,
8
+ "sides": [2, 2, 1]
9
+ },
10
+ "operations": {
11
+ "post": {}
12
+ },
13
+ "goal": {
14
+ "counters": {
15
+ "max": "pieces"
16
+ }
17
+ }
18
+ },
19
+ "seed": "0",
20
+ "sequences": [],
21
+ "proof": {
22
+ "undecided": "invalid",
23
+ "errors": [
24
+ {
25
+ "path": "/line/vertical",
26
+ "message": "a ring is never drawn upright"
27
+ },
28
+ {
29
+ "path": "/line/sides",
30
+ "message": "the sides' gaps together are the ring's places, 6"
31
+ }
32
+ ]
33
+ }
34
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "description": "A scene the kind refuses, with every error it names: a jump as long as the line, and a goal that names a counter of an operation the scene does not allow and asks both the greatest and the least.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 5,
6
+ "first": 1
7
+ },
8
+ "operations": {
9
+ "jump": {
10
+ "from": 1,
11
+ "step": 5
12
+ }
13
+ },
14
+ "goal": {
15
+ "counters": {
16
+ "is": {
17
+ "pieces": 2
18
+ },
19
+ "max": "posts",
20
+ "min": "gaps"
21
+ }
22
+ }
23
+ },
24
+ "seed": "0",
25
+ "sequences": [],
26
+ "proof": {
27
+ "undecided": "invalid",
28
+ "errors": [
29
+ {
30
+ "path": "/operations/jump/step",
31
+ "message": "a whole number from 1 to 4"
32
+ },
33
+ {
34
+ "path": "/goal/counters/is/pieces",
35
+ "message": "no counter of the scene has this name"
36
+ },
37
+ {
38
+ "path": "/goal/counters",
39
+ "message": "max or min, never both"
40
+ }
41
+ ]
42
+ }
43
+ }
@@ -0,0 +1,104 @@
1
+ {
2
+ "description": "A jumper of two places that may jump back, from stone 1 of 9, never lands on stone 8: its places are the odd ones, and the key is unreachable, its graph five places in a row. A jump back from stone 1 and one forward from stone 9 would leave the line.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 9,
6
+ "first": 1
7
+ },
8
+ "operations": {
9
+ "jump": {
10
+ "from": 1,
11
+ "step": 2,
12
+ "back": true
13
+ }
14
+ },
15
+ "goal": {
16
+ "counters": {
17
+ "is": {
18
+ "at": 8
19
+ }
20
+ }
21
+ }
22
+ },
23
+ "seed": "0",
24
+ "start": {
25
+ "state": {
26
+ "posts": [],
27
+ "at": 1
28
+ },
29
+ "goal": false
30
+ },
31
+ "sequences": [
32
+ [
33
+ {
34
+ "move": {
35
+ "jump": "back"
36
+ },
37
+ "refused": "off-line"
38
+ },
39
+ {
40
+ "move": {
41
+ "jump": "forward"
42
+ },
43
+ "state": {
44
+ "posts": [],
45
+ "at": 3
46
+ },
47
+ "goal": false
48
+ },
49
+ {
50
+ "move": {
51
+ "jump": "forward"
52
+ },
53
+ "state": {
54
+ "posts": [],
55
+ "at": 5
56
+ },
57
+ "goal": false
58
+ },
59
+ {
60
+ "move": {
61
+ "jump": "forward"
62
+ },
63
+ "state": {
64
+ "posts": [],
65
+ "at": 7
66
+ },
67
+ "goal": false
68
+ },
69
+ {
70
+ "move": {
71
+ "jump": "forward"
72
+ },
73
+ "state": {
74
+ "posts": [],
75
+ "at": 9
76
+ },
77
+ "goal": false
78
+ },
79
+ {
80
+ "move": {
81
+ "jump": "forward"
82
+ },
83
+ "refused": "off-line"
84
+ },
85
+ {
86
+ "move": {
87
+ "jump": "back"
88
+ },
89
+ "state": {
90
+ "posts": [],
91
+ "at": 7
92
+ },
93
+ "goal": false
94
+ }
95
+ ]
96
+ ],
97
+ "proof": {
98
+ "key": "unreachable",
99
+ "witness": {
100
+ "layers": [1, 1, 1, 1, 1]
101
+ },
102
+ "ends": []
103
+ }
104
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "description": "Posts on twelve free places, a post on every one the goal: the 4,096 sets of posts pass the kind's limit of 3,000 states, and the scene does not decide.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 12,
6
+ "first": 1
7
+ },
8
+ "operations": {
9
+ "post": {}
10
+ },
11
+ "goal": {
12
+ "every": {}
13
+ }
14
+ },
15
+ "seed": "0",
16
+ "start": {
17
+ "state": {
18
+ "posts": []
19
+ },
20
+ "goal": false
21
+ },
22
+ "sequences": [
23
+ [
24
+ {
25
+ "move": {
26
+ "post": {
27
+ "at": 12
28
+ }
29
+ },
30
+ "state": {
31
+ "posts": [12]
32
+ },
33
+ "goal": false
34
+ }
35
+ ]
36
+ ],
37
+ "proof": {
38
+ "undecided": "limit"
39
+ }
40
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "description": "A line only to look at, with its posts and no goal: a move of an operation the kind has but the scene does not allow is refused, and the scene has nothing to prove.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 4,
6
+ "first": 1,
7
+ "posts": [1, 4]
8
+ },
9
+ "operations": {}
10
+ },
11
+ "seed": "0",
12
+ "start": {
13
+ "state": {
14
+ "posts": [1, 4]
15
+ },
16
+ "goal": false
17
+ },
18
+ "sequences": [
19
+ [
20
+ {
21
+ "move": {
22
+ "post": {
23
+ "at": 2
24
+ }
25
+ },
26
+ "refused": "op-not-in-scene"
27
+ },
28
+ {
29
+ "move": {
30
+ "cut": {
31
+ "at": 2
32
+ }
33
+ },
34
+ "refused": "op-not-in-scene"
35
+ },
36
+ {
37
+ "move": {
38
+ "jump": "forward"
39
+ },
40
+ "refused": "op-not-in-scene"
41
+ }
42
+ ]
43
+ ],
44
+ "proof": {
45
+ "undecided": "no-goal"
46
+ }
47
+ }
@@ -0,0 +1,104 @@
1
+ {
2
+ "description": "A ring of six places, a necklace, cut into three pieces: it has no end, so a cut at any place is taken, the first opens it into one piece, and the fewest cuts that leave three pieces are 3, as many as the pieces. A cut where the ring is cut already is refused.",
3
+ "scene": {
4
+ "line": {
5
+ "places": 6,
6
+ "first": 1,
7
+ "closed": true
8
+ },
9
+ "operations": {
10
+ "cut": {}
11
+ },
12
+ "goal": {
13
+ "counters": {
14
+ "is": {
15
+ "pieces": 3
16
+ }
17
+ }
18
+ }
19
+ },
20
+ "seed": "0",
21
+ "start": {
22
+ "state": {
23
+ "posts": [],
24
+ "cuts": []
25
+ },
26
+ "goal": false
27
+ },
28
+ "sequences": [
29
+ [
30
+ {
31
+ "move": {
32
+ "cut": {
33
+ "at": 1
34
+ }
35
+ },
36
+ "state": {
37
+ "posts": [],
38
+ "cuts": [1]
39
+ },
40
+ "goal": false
41
+ },
42
+ {
43
+ "move": {
44
+ "cut": {
45
+ "at": 1
46
+ }
47
+ },
48
+ "refused": "cut"
49
+ },
50
+ {
51
+ "move": {
52
+ "cut": {
53
+ "at": 6
54
+ }
55
+ },
56
+ "state": {
57
+ "posts": [],
58
+ "cuts": [1, 6]
59
+ },
60
+ "goal": false
61
+ },
62
+ {
63
+ "move": {
64
+ "cut": {
65
+ "at": 3
66
+ }
67
+ },
68
+ "state": {
69
+ "posts": [],
70
+ "cuts": [1, 3, 6]
71
+ },
72
+ "goal": true
73
+ }
74
+ ]
75
+ ],
76
+ "proof": {
77
+ "key": 3,
78
+ "witness": {
79
+ "path": [
80
+ {
81
+ "cut": {
82
+ "at": 1
83
+ }
84
+ },
85
+ {
86
+ "cut": {
87
+ "at": 2
88
+ }
89
+ },
90
+ {
91
+ "cut": {
92
+ "at": 3
93
+ }
94
+ }
95
+ ]
96
+ },
97
+ "ends": [
98
+ {
99
+ "posts": [],
100
+ "cuts": [1, 2, 3]
101
+ }
102
+ ]
103
+ }
104
+ }