source: trunk/Examples/Others/oobrain.b

Last change on this file was 11, checked in by chronos, 12 years ago
  • Added: Some other examples from web.
File size: 63.8 KB
Line 
1%%
2%% (C) 2003 Chris Rathman
3%%
4
5%% reserve some space for a stack (note: each stack entry takes two cells ~ value and a walk byte)
6>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
7>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
8>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
9
10%%
11%% Object Definition:
12%%
13%% < object# >
14%% << function#/step# >>
15%% <<< class# >>>
16%% <<<< slot#1 (main!shape(0) | circle!x | rectangle!x) >>>>
17%% <<<<< slot#2 (main!shape(1) | circle!y | rectangle!y) >>>>>
18%% <<<<<< slot#3 (main!rect | circle!radius | rectangle!width) >>>>>>
19%% <<<<<<< slot#4 ( | | rectangle!height) >>>>>>>
20%% <<<<<<<< slot#5 >>>>>>>>
21%% <<<<<<<<< reserved >>>>>>>>>
22%% <<<<<<<<<<<<<<<<<<<< object length >>>>>>>>>>>>>>>>>>>>
23%%
24
25%% auto-allocate main root object
26>>>>>>>>>>>> 9~20 %% workspace (for previous object)
27[-]> 8 %% slot#5
28[-]> 7 %% slot#4
29[-]> 6 %% slot#3
30[-]> 5 %% slot#2
31[-]> 4 %% slot#1
32[-]> 3 %% class#
33[-]> 2 %% function#/step#
34[-]> 1 %% object#
35
36%% stack push step#1 for main object
37<<<<<<<<<<<<<<<<<<<< [<<]+<+>[>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push step#
38<<<<<<<<<<<<<<<<<<<< [<<]+<> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push object#
39
40<<<<<<<<<<<<<<<<<<<< <<[>> >>>>>>>>>>>>>>>>>>>> %% while stack do
41
42 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull next object#
43 <[> [>>] << >>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
44 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
45
46 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull next function#/step#
47 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
48 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
49 [ %% walk to next object#n
50 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
51 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
52 >>>>>>>>>>>>>>>>>>>>
53 -]
54
55 <<[-]>> >[<< <+> >>-]< %% set function#/step# for the object
56
57
58 ================================================================================================
59 = main process =
60 ================================================================================================
61 [-]<<<[>>>+>+<<< <-]>>> >[<<< <+> >>>-]< %% get class#
62 >[-] [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (class#0)
63
64 %% set to return to the next step# after continue
65 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< + %% get step#
66 <<<<<<<<<<<<<<<<<<<< [<<]+<++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push step#
67 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for step#
68 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push step#
69 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push object#
70
71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 % step#1 new shape() %
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
75 >[-]+ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#1)
76
77 %% allocate a new object in the heap
78 <[<<<<<<<<<<<<<<<<<<<<]> %% walk back to root object
79 >>>>>>>>>>>>>>>>>>>> %% skip over first object
80 <[> %% find free space in the heap
81 [-]<[>+>+< <-]> >[< <+> >-]< %% get object#
82 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<<-]
83 >>>>>>>>>>>>>>>>>>>>
84 <]>
85 <[-]+ >[<+>-]<> %% object#n
86 <<<[-]+>>> %% class# rectangle
87 [-]<[>+>+< <-]> >[< <+> >-]< %% get new object#
88 <[ %% walk back to root object
89 >[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]<
90 <<<<<<<<<<<<<<<<<<<<
91 ]>
92
93 %% set local slot# for shape(0)
94 [<<<< + >>>> -] %% set slot# shape(0)
95
96 %% make a function call: shape(0) = new rectangle(x y width height)
97 <<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get shape(0) from slot
98 <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# height = 6
99 <++++++>
100 [>>]<< >>>>>>>>>>>>>>>>>>>>
101 <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# width = 5
102 <+++++>
103 [>>]<< >>>>>>>>>>>>>>>>>>>>
104 <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# y = 20
105 <++++++++++++++++++++>
106 [>>]<< >>>>>>>>>>>>>>>>>>>>
107 <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# x = 10
108 <++++++++++>
109 [>>]<< >>>>>>>>>>>>>>>>>>>>
110 <<<<<<<<<<<<<<<<<<<< [<<]+<+> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# rectangle
111 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
112 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(0)
113
114 %% allocate a new object in the heap
115 <[<<<<<<<<<<<<<<<<<<<<]> %% walk back to root object
116 >>>>>>>>>>>>>>>>>>>> %% skip over first object
117 <[> %% find free space in the heap
118 [-]<[>+>+< <-]> >[< <+> >-]< %% get object#
119 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<<-]
120 >>>>>>>>>>>>>>>>>>>>
121 <]>
122 <[-]+ >[<+>-]<> %% object#n
123 <<<[-]++>>> %% class#
124 [-]<[>+>+< <-]> >[< <+> >-]< %% get new object#
125 <[ %% walk back to root object
126 >[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]<
127 <<<<<<<<<<<<<<<<<<<<
128 ]>
129
130 %% set local slot# for shape(1)
131 [<<<<< + >>>>> -] %% set slot# shape(1)
132
133 %% make a function call: shape(1) = new circle(x y radius)
134 <<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get shape(1) from slot
135 <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# radius = 8
136 <++++++++>
137 [>>]<< >>>>>>>>>>>>>>>>>>>>
138 <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# y = 25
139 <+++++++++++++++++++++++++>
140 [>>]<< >>>>>>>>>>>>>>>>>>>>
141 <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# x = 15
142 <+++++++++++++++>
143 [>>]<< >>>>>>>>>>>>>>>>>>>>
144 <<<<<<<<<<<<<<<<<<<< [<<]+<+> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# circle
145 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
146 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(1)
147 >]< %% END IF (function#1)
148
149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150 % step#2 shape!draw() %
151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
152 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
153 >[-]++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#2)
154 %% get the two shapes to process
155 <<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get shape(0) from slot
156 [>>>>+<<<<-] %% push shape(0) in the workspace
157 <<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get shape(1) from slot
158 [>>>>>+<<<<<-] %% push shape(1) in the workspace
159
160 %% make a function call: shape(i)!draw()
161 >>>++[-<<< %% for i = 1 downto 0
162 >>>>[<<<<+>>>>-]<<<< %% get next shape to process
163 <<<<<<<<<<<<<<<<<<<< [<<]+<++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# draw
164 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
165 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(0)
166 >>>>>[<+>-]<<<<< %% pull down next shape
167 >>>]<<<
168 >]< %% END IF (function#1)
169
170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
171 % step#3 shape!rMoveTo() %
172 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
174 >[-]+++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#3)
175 %% get the two shapes to process
176 <<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get shape(0) from slot
177 [>>>>+<<<<-] %% push shape(0) in the workspace
178 <<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get shape(1) from slot
179 [>>>>>+<<<<<-] %% push shape(1) in the workspace
180
181 %% make a function call: shape(i)!rMoveTo(100)
182 >>>++[-<<< %% for i = 1 downto 0
183 >>>>[<<<<+>>>>-]<<<< %% get next shape to process
184 <<<<<<<<<<<<<<<<<<<< [<<] %% stack push param# dy = 100
185 <++++[>+++++<-]>[<+++++>-]<>+
186 [>>]<< >>>>>>>>>>>>>>>>>>>>
187 <<<<<<<<<<<<<<<<<<<< [<<] %% stack push param# dx = 100
188 <++++[>+++++<-]>[<+++++>-]<>+
189 [>>]<< >>>>>>>>>>>>>>>>>>>>
190 <<<<<<<<<<<<<<<<<<<< [<<]+<+++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# rmoveto
191 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
192 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(0)
193 >>>>>[<+>-]<<<<< %% pull down next shape
194 >>>]<<<
195 >]< %% END IF (function#1)
196
197 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
198 % step#4 shape!draw() %
199 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
200 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
201 >[-]++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#4)
202 %% get the two shapes to process
203 <<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get shape(0) from slot
204 [>>>>+<<<<-] %% push shape(0) in the workspace
205 <<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get shape(1) from slot
206 [>>>>>+<<<<<-] %% push shape(1) in the workspace
207
208 %% make a function call: shape(i)!draw()
209 >>>++[-<<< %% for i = 1 downto 0
210 >>>>[<<<<+>>>>-]<<<< %% get next shape to process
211 <<<<<<<<<<<<<<<<<<<< [<<]+<++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# draw
212 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
213 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(0)
214 >>>>>[<+>-]<<<<< %% pull down next shape
215 >>>]<<<
216 >]< %% END IF (function#1)
217
218 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
219 % step#5 new rect() %
220 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
221 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
222 >[-]+++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#5)
223
224 %% allocate a new object in the heap
225 <[<<<<<<<<<<<<<<<<<<<<]> %% walk back to root object
226 >>>>>>>>>>>>>>>>>>>> %% skip over first object
227 <[> %% find free space in the heap
228 [-]<[>+>+< <-]> >[< <+> >-]< %% get object#
229 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<<-]
230 >>>>>>>>>>>>>>>>>>>>
231 <]>
232 <[-]+ >[<+>-]<> %% object#n
233 <<<[-]+>>> %% class# rectangle
234 [-]<[>+>+< <-]> >[< <+> >-]< %% get new object#
235 <[ %% walk back to root object
236 >[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]<
237 <<<<<<<<<<<<<<<<<<<<
238 ]>
239
240 %% set local slot# for rect
241 [<<<<<< + >>>>>> -] %% set slot# rect
242
243 %% make a function call: rect = new rectangle(x y width height)
244 <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get rect from slot#
245 <<<<<<<<<<<<<<<<<<<< [<<]+<+++++++++++++++>[>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push param# height=15
246 <<<<<<<<<<<<<<<<<<<< [<<]+<+++++++++++++++>[>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push param# width=15
247 <<<<<<<<<<<<<<<<<<<< [<<]+<> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push param# y=0
248 <<<<<<<<<<<<<<<<<<<< [<<]+<> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push param# x=0
249 <<<<<<<<<<<<<<<<<<<< [<<]+<+> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# circle
250 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
251 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# rect
252 >]< %% END IF (function#1)
253
254 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255 % step#6 rect!setWidth() %
256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
257 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
258 >[-]++++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#6)
259 %% make a function call: rect!setRadius(radius)
260 <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get rect from slot#
261 <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# radius=30
262 <++++++++++++++++++++++++++++++>
263 [>>]<< >>>>>>>>>>>>>>>>>>>>
264 <<<<<<<<<<<<<<<<<<<< [<<]+<+++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# setRadius=30
265 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
266 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# rect
267 >]< %% END IF (function#1)
268
269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270 % step#7 rect!draw() %
271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
272 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
273 >[-]+++++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#7)
274 %% make a function call: rect!draw()
275 <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get shape(0) from slot
276 <<<<<<<<<<<<<<<<<<<< [<<]+<++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# draw
277 <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
278 [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# rect
279 >]< %% END IF (function#1)
280
281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
282 % step#8 exit() %
283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
284 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
285 >[-]++++++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#8)
286 <<<<<<<<<<<<<<<<<<<< <<[-]>> >>>>>>>>>>>>>>>>>>>> %% kill stack to exit
287 >]< %% END IF (function#99)
288
289 >]< %% END IF (class#0)
290
291
292
293 ================================================================================================
294 = rectangle class =
295 ================================================================================================
296 [-]<<<[>>>+>+<<< <-]>>> >[<<< <+> >>>-]< %% get class#
297 >[-]+ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (class#1)
298
299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
300 % function#1 rectangle(x y width height) %
301 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
302 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
303 >[-]+ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#1)
304 %% clear the slots
305 <<<<[-]>>>> %% x=0
306 <<<<<[-]>>>>> %% y=0
307 <<<<<<[-]>>>>>> %% width=0
308 <<<<<<<[-]>>>>>>> %% height=0
309
310 %% grab the x value from the stack
311 <[>+>+< <-]> >[< <+> >-]< %% get object#
312 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
313 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
314 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
315 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
316 [ %% walk to object#n (drag param# & object index)
317 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
318 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
319 >>>>>>>>>>>>>>>>>>>>
320 -]
321 >[< <<<<+>>>> >-]< %% set slot# x
322
323 %% grab the y value from the stack
324 <[>+>+< <-]> >[< <+> >-]< %% get object#
325 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
326 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
327 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
328 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
329 [ %% walk to object#n (drag param# & object index)
330 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
331 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
332 >>>>>>>>>>>>>>>>>>>>
333 -]
334 >[< <<<<<+>>>>> >-]< %% set slot# y
335
336 %% grab the width value from the stack
337 <[>+>+< <-]> >[< <+> >-]< %% get object#
338 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
339 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# width
340 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
341 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
342 [ %% walk to object#n (drag param# & object index)
343 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
344 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
345 >>>>>>>>>>>>>>>>>>>>
346 -]
347 >[< <<<<<<+>>>>>> >-]< %% set slot# width
348
349 %% grab the height value from the stack
350 <[>+>+< <-]> >[< <+> >-]< %% get object#
351 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
352 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# height
353 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
354 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
355 [ %% walk to object#n (drag param# & object index)
356 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
357 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
358 >>>>>>>>>>>>>>>>>>>>
359 -]
360 >[< <<<<<<<+>>>>>>> >-]< %% set slot# height
361 >]< %% END IF (function#1)
362
363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
364 % function#2 moveTo(x y) %
365 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
366 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
367 >[-]++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#2)
368 %% grab the x value from the stack
369 <<<<[-]>>>> %% x=0
370 <[>+>+< <-]> >[< <+> >-]< %% get object#
371 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
372 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
373 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
374 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
375 [ %% walk to object#n (drag param# & object index)
376 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
377 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
378 >>>>>>>>>>>>>>>>>>>>
379 -]
380 >[< <<<<+>>>> >-]< %% set slot# x
381
382 %% grab the y value from the stack
383 <<<<<[-]>>>>> %% y=0
384 <[>+>+< <-]> >[< <+> >-]< %% get object#
385 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
386 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
387 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
388 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
389 [ %% walk to object#n (drag param# & object index)
390 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
391 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
392 >>>>>>>>>>>>>>>>>>>>
393 -]
394 >[< <<<<<+>>>>> >-]< %% set slot# y
395 >]< %% END IF (function#2)
396
397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398 % function#3 rMoveTo(x y) %
399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
400 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
401 >[-]+++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#3)
402 %% grab the x value from the stack
403 <[>+>+< <-]> >[< <+> >-]< %% get object#
404 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
405 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
406 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
407 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
408 [ %% walk to object#n (drag param# & object index)
409 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
410 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
411 >>>>>>>>>>>>>>>>>>>>
412 -]
413 >[< <<<<+>>>> >-]< %% set slot# x
414
415 %% grab the y value from the stack
416 <[>+>+< <-]> >[< <+> >-]< %% get object#
417 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
418 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
419 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
420 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
421 [ %% walk to object#n (drag param# & object index)
422 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
423 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
424 >>>>>>>>>>>>>>>>>>>>
425 -]
426 >[< <<<<<+>>>>> >-]< %% set slot# y
427 >]< %% END IF (function#3)
428
429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
430 % function#5 setWidth(width) %
431 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
432 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
433 >[-]+++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#5)
434 %% grab the width value from the stack
435 <<<<<<[-]>>>>>> %% width=0
436 <[>+>+< <-]> >[< <+> >-]< %% get object#
437 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
438 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# width
439 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
440 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
441 [ %% walk to object#n (drag param# & object index)
442 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
443 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
444 >>>>>>>>>>>>>>>>>>>>
445 -]
446 >[< <<<<<<+>>>>>> >-]< %% set slot# width
447 >]< %% END IF (function#5)
448
449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
450 % function#6 setHeight(height) %
451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
452 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
453 >[-]++++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#6)
454 %% grab the height value from the stack
455 <<<<<<[-]>>>>>> %% height=0
456 <[>+>+< <-]> >[< <+> >-]< %% get object#
457 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
458 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# height
459 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
460 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
461 [ %% walk to object#n (drag param# & object index)
462 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
463 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
464 >>>>>>>>>>>>>>>>>>>>
465 -]
466 >[< <<<<<<<+>>>>>>> >-]< %% set slot# height
467 >]< %% END IF (function#5)
468
469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
470 % function#4 draw() %
471 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
472 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
473 >[-]++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#4)
474 [-] #64# >++++++++[<++++++++>-]< ++++. %% D
475 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
476 [-] #64# >++++++++[<++++++++>-]< +. %% A
477 [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++++++. %% W
478 [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
479 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++. %% N
480 [-] #64# >++++++++[<++++++++>-]< +++++++. %% G
481 [-] #30# >+++++[<++++++>-]< ++. %%
482 [-] #64# >++++++++[<++++++++>-]< +. %% A
483 [-] #30# >+++++[<++++++>-]< ++. %%
484 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
485 [-] #64# >++++++++[<++++++++>-]< +++++. %% E
486 [-] #64# >++++++++[<++++++++>-]< +++. %% C
487 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
488 [-] #64# >++++++++[<++++++++>-]< +. %% A
489 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++. %% N
490 [-] #64# >++++++++[<++++++++>-]< +++++++. %% G
491 [-] #64# >++++++++[<++++++++>-]< ++++++++++++. %% L
492 [-] #64# >++++++++[<++++++++>-]< +++++. %% E
493 [-] #30# >+++++[<++++++>-]< ++. %%
494 [-] #64# >++++++++[<++++++++>-]< +. %% A
495 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
496 [-] #30# >+++++++[<++++++++>-]< ++. %% :
497 [-] #42# >++++++[<+++++++>-]< --. %% (
498 [-] <<<<[>>>>+>+<<<< <-]>>>> [<<<< + >>>>-] %% x
499 >[ %% output number
500 [>+>+<<-]>>[<<+>>-]< %% dup
501 >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
502 >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
503 [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
504 >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
505 >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
506 <+> %% inc1
507 ]
508 <[
509 [>+<-] %% mover
510 +++++++[<+++++++>-]<-> %% add48
511 <.[-]> %% putc
512 >[<<+>>-]< %% movel2
513 <-]
514 [-]<<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get slot# x
515 >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (x=0)
516 [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
517 >]< %% END IF (x=0)
518 [-] #42# >++++++[<+++++++>-]< ++. %% comma
519 [-] <<<<<[>>>>>+>+<<<<< <-]>>>>> [<<<<< + >>>>>-] %% y
520 >[ %% output number
521 [>+>+<<-]>>[<<+>>-]< %% dup
522 >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
523 >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
524 [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
525 >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
526 >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
527 <+> %% inc1
528 ]
529 <[
530 [>+<-] %% mover
531 +++++++[<+++++++>-]<-> %% add48
532 <.[-]> %% putc
533 >[<<+>>-]< %% movel2
534 <-]
535 [-]<<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get slot# y
536 >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (y=0)
537 [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
538 >]< %% END IF (y=0)
539 [-] #42# >++++++[<+++++++>-]< -. %% )
540 [-] #42# >++++++[<+++++++>-]< ++. %% comma
541 [-] #30# >+++++[<++++++>-]< ++. %%
542 [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++++++. %% W
543 [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
544 [-] #64# >++++++++[<++++++++>-]< ++++. %% D
545 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
546 [-] #64# >++++++++[<++++++++>-]< ++++++++. %% H
547 [-] #30# >+++++[<++++++>-]< ++. %%
548 [-] <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> [<<<<<< + >>>>>>-] %% width
549 >[ %% output number
550 [>+>+<<-]>>[<<+>>-]< %% dup
551 >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
552 >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
553 [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
554 >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
555 >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
556 <+> %% inc1
557 ]
558 <[
559 [>+<-] %% mover
560 +++++++[<+++++++>-]<-> %% add48
561 <.[-]> %% putc
562 >[<<+>>-]< %% movel2
563 <-]
564 [-]<<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get slot# width
565 >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (width=0)
566 [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
567 >]< %% END IF (width=0)
568 [-] #42# >++++++[<+++++++>-]< ++. %% comma
569 [-] #30# >+++++[<++++++>-]< ++. %%
570 [-] #64# >++++++++[<++++++++>-]< ++++++++. %% H
571 [-] #64# >++++++++[<++++++++>-]< +++++. %% E
572 [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
573 [-] #64# >++++++++[<++++++++>-]< +++++++. %% G
574 [-] #64# >++++++++[<++++++++>-]< ++++++++. %% H
575 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
576 [-] #30# >+++++[<++++++>-]< ++. %%
577 [-] <<<<<<<[>>>>>>>+>+<<<<<<< <-]>>>>>>> [<<<<<<< + >>>>>>>-] %% width
578 >[ %% output number
579 [>+>+<<-]>>[<<+>>-]< %% dup
580 >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
581 >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
582 [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
583 >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
584 >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
585 <+> %% inc1
586 ]
587 <[
588 [>+<-] %% mover
589 +++++++[<+++++++>-]<-> %% add48
590 <.[-]> %% putc
591 >[<<+>>-]< %% movel2
592 <-]
593 [-]<<<<<<<[>>>>>>>+>+<<<<<<< <-]>>>>>>> >[<<<<<<< <+> >>>>>>>-]< %% get slot# height
594 >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (height=0)
595 [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
596 >]< %% END IF (height=0)
597 [-] ++++++++++.[-] %% \n
598 >]< %% END IF (function#4)
599
600 >]< %% END IF (class#2)
601
602
603
604 ================================================================================================
605 = circle class =
606 ================================================================================================
607 [-]<<<[>>>+>+<<< <-]>>> >[<<< <+> >>>-]< %% get class#
608 >[-]++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (class#2)
609
610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
611 % function#1 circle(x y radius) %
612 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
613 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
614 >[-]+ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#1)
615 %% clear the slots
616 <<<<[-]>>>> %% x=0
617 <<<<<[-]>>>>> %% y=0
618 <<<<<<[-]>>>>>> %% radius=0
619
620 %% grab the x value from the stack
621 <[>+>+< <-]> >[< <+> >-]< %% get object#
622 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
623 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
624 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
625 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
626 [ %% walk to object#n (drag param# & object index)
627 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
628 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
629 >>>>>>>>>>>>>>>>>>>>
630 -]
631 >[< <<<<+>>>> >-]< %% set slot# x
632
633 %% grab the y value from the stack
634 <[>+>+< <-]> >[< <+> >-]< %% get object#
635 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
636 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
637 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
638 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
639 [ %% walk to object#n (drag param# & object index)
640 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
641 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
642 >>>>>>>>>>>>>>>>>>>>
643 -]
644 >[< <<<<<+>>>>> >-]< %% set slot# y
645
646 %% grab the radius value from the stack
647 <[>+>+< <-]> >[< <+> >-]< %% get object#
648 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
649 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# radius
650 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
651 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
652 [ %% walk to object#n (drag param# & object index)
653 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
654 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
655 >>>>>>>>>>>>>>>>>>>>
656 -]
657 >[< <<<<<<+>>>>>> >-]< %% set slot# radius
658 >]< %% END IF (function#1)
659
660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
661 % function#2 moveTo(x y) %
662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
663 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
664 >[-]++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#2)
665 %% grab the x value from the stack
666 <<<<[-]>>>> %% x=0
667 <[>+>+< <-]> >[< <+> >-]< %% get object#
668 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
669 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
670 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
671 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
672 [ %% walk to object#n (drag param# & object index)
673 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
674 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
675 >>>>>>>>>>>>>>>>>>>>
676 -]
677 >[< <<<<+>>>> >-]< %% set slot# x
678
679 %% grab the y value from the stack
680 <<<<<[-]>>>>> %% y=0
681 <[>+>+< <-]> >[< <+> >-]< %% get object#
682 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
683 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
684 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
685 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
686 [ %% walk to object#n (drag param# & object index)
687 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
688 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
689 >>>>>>>>>>>>>>>>>>>>
690 -]
691 >[< <<<<<+>>>>> >-]< %% set slot# y
692 >]< %% END IF (function#2)
693
694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
695 % function#3 rMoveTo(x y) %
696 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
697 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
698 >[-]+++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#3)
699 %% grab the x value from the stack
700 <[>+>+< <-]> >[< <+> >-]< %% get object#
701 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
702 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
703 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
704 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
705 [ %% walk to object#n (drag param# & object index)
706 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
707 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
708 >>>>>>>>>>>>>>>>>>>>
709 -]
710 >[< <<<<+>>>> >-]< %% set slot# x
711
712 %% grab the y value from the stack
713 <[>+>+< <-]> >[< <+> >-]< %% get object#
714 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
715 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
716 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
717 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
718 [ %% walk to object#n (drag param# & object index)
719 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
720 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
721 >>>>>>>>>>>>>>>>>>>>
722 -]
723 >[< <<<<<+>>>>> >-]< %% set slot# y
724 >]< %% END IF (function#3)
725
726 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
727 % function#5 setRadius(radius) %
728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
729 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
730 >[-]+++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#5)
731 %% grab the radius value from the stack
732 <<<<<<[-]>>>>>> %% radius=0
733 <[>+>+< <-]> >[< <+> >-]< %% get object#
734 <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
735 <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# radius
736 <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
737 [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
738 [ %% walk to object#n (drag param# & object index)
739 >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
740 [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
741 >>>>>>>>>>>>>>>>>>>>
742 -]
743 >[< <<<<<<+>>>>>> >-]< %% set slot# radius
744 >]< %% END IF (function#5)
745
746 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
747 % function#4 draw() %
748 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
749 [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
750 >[-]++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#4)
751 [-] #64# >++++++++[<++++++++>-]< ++++. %% D
752 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
753 [-] #64# >++++++++[<++++++++>-]< +. %% A
754 [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++++++. %% W
755 [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
756 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++. %% N
757 [-] #64# >++++++++[<++++++++>-]< +++++++. %% G
758 [-] #30# >+++++[<++++++>-]< ++. %%
759 [-] #64# >++++++++[<++++++++>-]< +. %% A
760 [-] #30# >+++++[<++++++>-]< ++. %%
761 [-] #64# >++++++++[<++++++++>-]< +++. %% C
762 [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
763 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
764 [-] #64# >++++++++[<++++++++>-]< +++. %% C
765 [-] #64# >++++++++[<++++++++>-]< ++++++++++++. %% L
766 [-] #64# >++++++++[<++++++++>-]< +++++. %% E
767 [-] #30# >+++++[<++++++>-]< ++. %%
768 [-] #64# >++++++++[<++++++++>-]< +. %% A
769 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
770 [-] #30# >+++++++[<++++++++>-]< ++. %% :
771 [-] #42# >++++++[<+++++++>-]< --. %% (
772 [-] <<<<[>>>>+>+<<<< <-]>>>> [<<<< + >>>>-] %% x
773 >[ %% output number
774 [>+>+<<-]>>[<<+>>-]< %% dup
775 >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
776 >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
777 [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
778 >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
779 >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
780 <+> %% inc1
781 ]
782 <[
783 [>+<-] %% mover
784 +++++++[<+++++++>-]<-> %% add48
785 <.[-]> %% putc
786 >[<<+>>-]< %% movel2
787 <-]
788 [-]<<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get slot# x
789 >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (x=0)
790 [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
791 >]< %% END IF (x=0)
792 [-] #42# >++++++[<+++++++>-]< ++. %% comma
793 [-] <<<<<[>>>>>+>+<<<<< <-]>>>>> [<<<<< + >>>>>-] %% y
794 >[ %% output number
795 [>+>+<<-]>>[<<+>>-]< %% dup
796 >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
797 >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
798 [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
799 >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
800 >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
801 <+> %% inc1
802 ]
803 <[
804 [>+<-] %% mover
805 +++++++[<+++++++>-]<-> %% add48
806 <.[-]> %% putc
807 >[<<+>>-]< %% movel2
808 <-]
809 [-]<<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get slot# y
810 >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (y=0)
811 [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
812 >]< %% END IF (y=0)
813 [-] #42# >++++++[<+++++++>-]< -. %% )
814 [-] #42# >++++++[<+++++++>-]< ++. %% comma
815 [-] #30# >+++++[<++++++>-]< ++. %%
816 [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
817 [-] #64# >++++++++[<++++++++>-]< +. %% A
818 [-] #64# >++++++++[<++++++++>-]< ++++. %% D
819 [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
820 [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++++. %% U
821 [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++. %% S
822 [-] #30# >+++++[<++++++>-]< ++. %%
823 [-] <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> [<<<<<< + >>>>>>-] %% radius
824 >[ %% output number
825 [>+>+<<-]>>[<<+>>-]< %% dup
826 >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
827 >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
828 [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
829 >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
830 >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
831 <+> %% inc1
832 ]
833 <[
834 [>+<-] %% mover
835 +++++++[<+++++++>-]<-> %% add48
836 <.[-]> %% putc
837 >[<<+>>-]< %% movel2
838 <-]
839 [-]<<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get slot# radius
840 >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (radius=0)
841 [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
842 >]< %% END IF (radius=0)
843 [-] ++++++++++.[-] %% \n
844 >]< %% END IF (function#4)
845
846 >]< %% END IF (class#2)
847
848
849 <[<<<<<<<<<<<<<<<<<<<<]> %% walk back to root object
850<<<<<<<<<<<<<<<<<<<< <<]
851
852%%
853%% [ http://www.angelfire.com/tx4/cus/shapes/ ]
854%%
Note: See TracBrowser for help on using the repository browser.