-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathfun.en.robomarkup
230 lines (131 loc) · 10.2 KB
/
fun.en.robomarkup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// Pseudo markup format see ./README.md
#!unlock type{short} id{s-left}
`robo_left() ` stays on the same tile, moves left
#!unlock type{short} id{s-forward}
`robo_forward() ` moves forward (also veers right because triangles)
#!unlock type{short} id{s-scan}
`robo_scan() ` scan the tile in front returns `-999`: unknown, `-1`: absent, `1`: normal, `2`: exit
#!unlock type{short} id{s-scan-u1}
`robo_scan() ` scan the tile in front returns `-999`: unknown, `-1`: absent, `1`: normal, `2`: exit, `10`: power switch
#!unlock type{short} id{s-scan-u2}
`robo_scan() ` scan the tile in front returns `-999`: unknown, `-1`: absent, `1`: normal, `2`: exit, `10`: power switch, `11`: location data store
#!unlock type{short} id{s-scan-u3}
`robo_scan() ` scan the tile in front returns `-999`: unknown, `-1`: absent, `1`: normal, `2`: exit, `10`: power switch, `11`: location data store, `12`: direction data store
#!unlock type{short} id{s-scan-u4}
`robo_scan() ` scan the tile in front returns `-999`: unknown, `-1`: absent, `1`: normal, `2`: exit, `3`: launcher, `10`: power switch, `11`: location data store, `12`: direction data store
#!unlock type{short} id{s-use}
`robo_use() ` use current tile, returns: power switch `1`: on, `0`: off
#!unlock type{short} id{s-use-u2}
`robo_use() ` use current tile, returns: power switch `1`: on, `0`: off, location data store: safe location id
#!unlock type{short} id{s-use-u3}
`robo_use() ` use current tile, returns: power switch `1`: on, `0`: off, location data store: safe location id, directions `1`: up, `2`: right
#!unlock type{short} id{s-use-u4}
`robo_use() ` use current tile, returns: power switch `1`: on, `0`: off, location data store: safe location id, directions `1`: up, `2`: right, `3`: down, `4`: left
#!unlock type{short} id{s-detect-adjacent}
`robo_detect_adjacent() ` returns the number of non-absent adjacent tiles, unaffected by unknowns
#!unlock type{short} id{s-location}
`robo_location() ` returns current location id
#!unlock type{short} id{s-forward-location}
`robo_forward_location() ` returns location id of tile in front
#!unlock type{short} id{s-detect-3}
`robo_detect_3() ` returns the number of non-absent forward 3 tiles (rightward), unaffected by unknowns
#!unlock type{short} id{s-detect-3l}
`robo_detect_3l() ` returns the number of non-absent forward 3 tiles (leftward), unaffected by unknowns
#!unlock type{short} id{s-probo-left}
`probo_left() ` stays on the same tile, turns left
#!unlock type{short} id{s-probo-forward}
`probo_forward() ` moves forward (also turns somewhat right)
#!unlock type{short} id{s-probo-scan}
`probo_scan() ` scan current tile, returns `-999`: unknown, `-1`: absent, `1`: normal, `2`: exit, `3`: launcher, `10`: power switch, `11`: location data store, `12`: direction data store
#!unlock type{short} id{s-probo-location}
`probo_location() ` returns current location
#!unlock type{short} id{s-probo-use}
`probo_use() ` use current tile, returns: power switch `1`: on, `0`: off, location data store: safe location id, directions `1`: up, `2`: right, `3`: down, `4`: left
#!unlock type{short} id{s-transmit}
`transmit(subject,data) ` transmits data on a subject
#!unlock type{short} id{s-receive}
`receive(subject) ` consumes & returns oldest subject data value or `-20000` if none exists
#!unlock type{functions} id{left-forward}
`robo_left()` Each call instructs the robot to move to the next side of the current tile, counter-clockwise. Runtime $tu{robo_left()} Mimas-seconds (ms).
$render{robo_left}
`robo_forward()` Instructs the robot to move forward onto a tile it's currently facing. The robot will favour veering to the right hand side when doing this. Runtime $tu{robo_forward()} ms.
$render{robo_forward}
#!unlock type{function} id{scan}
`robo_scan()` Scans the tile in front, returns a value indicating the tile properties. `1` means a normal tile, `2` an exit, `-1` means no tile at all, `-999` means unknown. Runtime $tu{robo_scan()} ms.
$render{robo_scan}
#!unlock type{function-update} id{scan-u1}
`robo_scan()` Scans the tile in front, returns a value indicating the tile properties. `1` means a normal tile, `2`: exit, `-1`: no tile at all, `-999`: unknown, `10`: power switch. Runtime $tu{robo_scan()} ms.
$render{robo_scan}
#!unlock type{function-update} id{scan-u2}
`robo_scan()` Scans the tile in front, returns a value indicating the tile properties. `1` means a normal tile, `2`: exit, `-1`: no tile at all, `-999`: unknown, `10`: power switch, `11`: location data store. Runtime $tu{robo_scan()} ms.
$render{robo_scan}
#!unlock type{function-update} id{scan-u3}
`robo_scan()` Scans the tile in front, returns a value indicating the tile properties. `1` means a normal tile, `2`: exit, `-1`: no tile at all, `-999`: unknown, `10`: power switch, `11`: location data store, `12`: direction data store. Runtime $tu{robo_scan()} ms.
$render{robo_scan}
#!unlock type{function-update} id{scan-u4}
`robo_scan()` Scans the tile in front, returns a value indicating the tile properties. `1` means a normal tile, `2`: exit, `-1`: no tile at all, `-999`: unknown, `3`: launcher tile, `10`: power switch, `11`: location data store, `12`: direction data store. Runtime $tu{robo_scan()} ms.
$render{robo_scan}
#!unlock type{function} id{use}
`robo_use()` Operates on the current tile returning tile specific data, or `0` otherwise. Runtime $tu{robo_use()} ms
$render{robo_use}
#!unlock type{function-update} id{use-u1}
`robo_use()` Operates on the current tile returning tile specific data, or `0` otherwise. Runtime $tu{robo_use()} ms
- Power switch: Returns `1`: on, `0` off. Additional runtime +$tu{robo_use_power} ms
$render{robo_use}
#!unlock type{function-update} id{use-u2}
`robo_use()` Operates on the current tile returning tile specific data, or `0` otherwise. Runtime $tu{robo_use()} ms
- Power switch: Returns `1`: on, `0` off. Additional runtime +$tu{robo_use_power} ms
- Location data store: Returns safe location id. Additional runtime +$tu{robo_use_location} ms
$render{robo_use-2}
#!unlock type{function-update} id{use-u3}
`robo_use()` Operates on the current tile returning tile specific data, or `0` otherwise. Runtime $tu{robo_use()} ms
- Power switch: Returns `1`: on, `0` off. Additional runtime +$tu{robo_use_power} ms
- Location data store: Returns safe location id. Additional runtime +$tu{robo_use_location} ms
- Direction data store: Returns `1`: up, `2`: right. Additional runtime +$tu{robo_use_direction} ms
$render{robo_use-3}
#!unlock type{function-update} id{use-u4}
`robo_use()` Operates on the current tile returning tile specific data, or `0` otherwise. Runtime $tu{robo_use()} ms
- Power switch: Returns `1`: on, `0` off. Additional runtime +$tu{robo_use_power} ms
- Location data store: Returns safe location id. Additional runtime +$tu{robo_use_location} ms
- Direction data store: Returns `1`: up, `2`: right, `3`: down, `4`: left. Additional runtime +$tu{robo_use_direction} ms
$render{robo_use-3}
#!unlock type{function} id{forward-location}
`robo_forward_location()` Returns the id of the tile the robot is facing. Runtime $tu{robo_forward_location()} ms.
$render{robo_forward_location}
```no_run
var location = robo_forward_location() # 8823
```
Each tile in a level has a distinct id number (positive & non-zero).
#!unlock type{function} id{location}
`robo_location()` Returns the id of the current tile the robot is standing on. Runtime $tu{robo_location()} ms.
$render{robo_location}
#!unlock type{function} id{detect-adjacent}
`robo_detect_adjacent()` Returns the total number of tiles adjacent to the current position. `0`, `1`, `2` or `3`. This works correctly even if some of the tiles are unknown to a `robo_scan()` call. Runtime $tu{robo_detect_adjacent()} ms.
$render{robo_detect_adjacent}
```no_run
var its_safe = robo_detect_adjacent() is 3
```
#!unlock type{function} id{detect-3}
`robo_detect_3()` Returns the total number of tiles in a straight right-veering line. This works correctly even if some of the tiles are unknown to a `robo_scan()` call. Runtime $tu{robo_detect_3()} ms.
$render{robo_detect_3}
#!unlock type{function} id{detect-3l}
`robo_detect_3l()` Returns the total number of tiles in a straight left-veering line. Similar to `robo_detect_3()`. Runtime $tu{robo_detect_3l()} ms.
$render{robo_detect_3l}
#!unlock type{functions} id{probo}
`probo_left()` Rotate left to face the next side of the current tile, counter-clockwise. Runtime $tu{probo_left()} ms.
`probo_forward()` Move the probe forward onto the tile space it's currently facing. New probe orientation veers rightwards. Runtime $tu{probo_forward()} ms.
`probo_location()` Returns the id of the current tile. Runtime $tu{probo_location()} ms.
`probo_scan()` Scans the current tile, returns a value indicating the tile properties. `1` means a normal tile, `2`: exit, `-1`: no tile at all, `-999`: unknown, `3`: launcher tile, `10`: power switch, `11`: location data store, `12`: direction data store. Runtime $tu{probo_scan()} ms.
$render{probo_scan}
#!unlock type{function-update} id{probo-scan-u1}
`probo_scan()` Scans the current tile, returns a value indicating the tile properties. `1` means a normal tile, `2`: exit, `-1`: no tile at all, `-999`: unknown, `3`: north launcher, `4`: south-east launcher, `5`: south-west launcher, `10`: power switch, `11`: location data store, `12`: direction data store. Runtime $tu{probo_scan()} ms.
$render{probo_scan-2}
#!unlock type{functions} id{transmit}
`transmit(subject,data)` Transmit a single `data` value associated with a `subject` value. Such transmissions may be received by other robots. Runtime $tu{transmit(vv)} ms.
`receive(subject)` Receive a single data value transmitted by another robot with matching `subject` value. Data transmissions are received in order. If there is no subject transmission to receive returns `-20000`. Runtime $tu{receive(v)} ms.
#!unlock type{function} id{probo-use}
`probo_use()` Operates on the current tile returning tile specific data, or `0` otherwise. Runtime $tu{probo_use()} ms
- Power switch: Returns `1`: on, `0` off. Additional runtime +$tu{robo_use_power} ms
- Location data store: Returns safe location id. Additional runtime +$tu{robo_use_location} ms
- Direction data store: Returns `1`: up, `2`: right, `3`: down, `4`: left. Additional runtime +$tu{robo_use_direction} ms
$render{probo_use}