oobrain.bf 64 KB

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