123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857 |
- %%
- %% (C) 2003 Chris Rathman
- %%
- %% This is a Object Oriented program (with runtime polymorphism) in brainfuck
- %% reserve some space for a stack (note: each stack entry takes two cells ~ value and a walk byte)
- >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
- >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
- >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
- %%
- %% Object Definition:
- %%
- %% < object# >
- %% << function#/step# >>
- %% <<< class# >>>
- %% <<<< slot#1 (main!shape(0) | circle!x | rectangle!x) >>>>
- %% <<<<< slot#2 (main!shape(1) | circle!y | rectangle!y) >>>>>
- %% <<<<<< slot#3 (main!rect | circle!radius | rectangle!width) >>>>>>
- %% <<<<<<< slot#4 ( | | rectangle!height) >>>>>>>
- %% <<<<<<<< slot#5 >>>>>>>>
- %% <<<<<<<<< reserved >>>>>>>>>
- %% <<<<<<<<<<<<<<<<<<<< object length >>>>>>>>>>>>>>>>>>>>
- %%
- %%[ auto-allocate main root object ]
- >>>>>>>>>>>> 9~20 %% workspace (for previous object)
- [-]> 8 %% slot#5
- [-]> 7 %% slot#4
- [-]> 6 %% slot#3
- [-]> 5 %% slot#2
- [-]> 4 %% slot#1
- [-]> 3 %% class#
- [-]> 2 %% function#/step#
- [-]> 1 %% object#
- %% stack push step#1 for main object
- <<<<<<<<<<<<<<<<<<<< [<<]+<+>[>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push step#
- <<<<<<<<<<<<<<<<<<<< [<<]+<> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push object#
- <<<<<<<<<<<<<<<<<<<< <<[>> >>>>>>>>>>>>>>>>>>>> %% while stack do
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull next object#
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull next function#/step#
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to next object#n
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- <<[-]>> >[<< <+> >>-]< %% set function#/step# for the object
- ================================================================================================
- = main process =
- ================================================================================================
- [-]<<<[>>>+>+<<< <-]>>> >[<<< <+> >>>-]< %% get class#
- >[-] [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (class#0)
- %% set to return to the next step# after continue
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< + %% get step#
- <<<<<<<<<<<<<<<<<<<< [<<]+<++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push step#
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for step#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push step#
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push object#
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % step#1 new shape() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#1)
- %% allocate a new object in the heap
- <[<<<<<<<<<<<<<<<<<<<<]> %% walk back to root object
- >>>>>>>>>>>>>>>>>>>> %% skip over first object
- <[> %% find free space in the heap
- [-]<[>+>+< <-]> >[< <+> >-]< %% get object#
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<<-]
- >>>>>>>>>>>>>>>>>>>>
- <]>
- <[-]+ >[<+>-]<> %% object#n
- <<<[-]+>>> %% class# rectangle
- [-]<[>+>+< <-]> >[< <+> >-]< %% get new object#
- <[ %% walk back to root object
- >[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]<
- <<<<<<<<<<<<<<<<<<<<
- ]>
- %% set local slot# for shape(0)
- [<<<< + >>>> -] %% set slot# shape(0)
- %% make a function call: shape(0) = new rectangle(x y width height)
- <<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get shape(0) from slot
- <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# height = 6
- <++++++>
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# width = 5
- <+++++>
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# y = 20
- <++++++++++++++++++++>
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# x = 10
- <++++++++++>
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+<+> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# rectangle
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(0)
- %% allocate a new object in the heap
- <[<<<<<<<<<<<<<<<<<<<<]> %% walk back to root object
- >>>>>>>>>>>>>>>>>>>> %% skip over first object
- <[> %% find free space in the heap
- [-]<[>+>+< <-]> >[< <+> >-]< %% get object#
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<<-]
- >>>>>>>>>>>>>>>>>>>>
- <]>
- <[-]+ >[<+>-]<> %% object#n
- <<<[-]++>>> %% class#
- [-]<[>+>+< <-]> >[< <+> >-]< %% get new object#
- <[ %% walk back to root object
- >[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]<
- <<<<<<<<<<<<<<<<<<<<
- ]>
- %% set local slot# for shape(1)
- [<<<<< + >>>>> -] %% set slot# shape(1)
- %% make a function call: shape(1) = new circle(x y radius)
- <<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get shape(1) from slot
- <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# radius = 8
- <++++++++>
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# y = 25
- <+++++++++++++++++++++++++>
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# x = 15
- <+++++++++++++++>
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+<+> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# circle
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(1)
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % step#2 shape!draw() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#2)
- %% get the two shapes to process
- <<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get shape(0) from slot
- [>>>>+<<<<-] %% push shape(0) in the workspace
- <<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get shape(1) from slot
- [>>>>>+<<<<<-] %% push shape(1) in the workspace
- %% make a function call: shape(i)!draw()
- >>>++[-<<< %% for i = 1 downto 0
- >>>>[<<<<+>>>>-]<<<< %% get next shape to process
- <<<<<<<<<<<<<<<<<<<< [<<]+<++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# draw
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(0)
- >>>>>[<+>-]<<<<< %% pull down next shape
- >>>]<<<
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % step#3 shape!rMoveTo() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#3)
- %% get the two shapes to process
- <<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get shape(0) from slot
- [>>>>+<<<<-] %% push shape(0) in the workspace
- <<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get shape(1) from slot
- [>>>>>+<<<<<-] %% push shape(1) in the workspace
- %% make a function call: shape(i)!rMoveTo(100)
- >>>++[-<<< %% for i = 1 downto 0
- >>>>[<<<<+>>>>-]<<<< %% get next shape to process
- <<<<<<<<<<<<<<<<<<<< [<<] %% stack push param# dy = 100
- <++++[>+++++<-]>[<+++++>-]<>+
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<] %% stack push param# dx = 100
- <++++[>+++++<-]>[<+++++>-]<>+
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+<+++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# rmoveto
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(0)
- >>>>>[<+>-]<<<<< %% pull down next shape
- >>>]<<<
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % step#4 shape!draw() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#4)
- %% get the two shapes to process
- <<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get shape(0) from slot
- [>>>>+<<<<-] %% push shape(0) in the workspace
- <<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get shape(1) from slot
- [>>>>>+<<<<<-] %% push shape(1) in the workspace
- %% make a function call: shape(i)!draw()
- >>>++[-<<< %% for i = 1 downto 0
- >>>>[<<<<+>>>>-]<<<< %% get next shape to process
- <<<<<<<<<<<<<<<<<<<< [<<]+<++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# draw
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# shape(0)
- >>>>>[<+>-]<<<<< %% pull down next shape
- >>>]<<<
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % step#5 new rect() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#5)
- %% allocate a new object in the heap
- <[<<<<<<<<<<<<<<<<<<<<]> %% walk back to root object
- >>>>>>>>>>>>>>>>>>>> %% skip over first object
- <[> %% find free space in the heap
- [-]<[>+>+< <-]> >[< <+> >-]< %% get object#
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<<-]
- >>>>>>>>>>>>>>>>>>>>
- <]>
- <[-]+ >[<+>-]<> %% object#n
- <<<[-]+>>> %% class# rectangle
- [-]<[>+>+< <-]> >[< <+> >-]< %% get new object#
- <[ %% walk back to root object
- >[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]<
- <<<<<<<<<<<<<<<<<<<<
- ]>
- %% set local slot# for rect
- [<<<<<< + >>>>>> -] %% set slot# rect
- %% make a function call: rect = new rectangle(x y width height)
- <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get rect from slot#
- <<<<<<<<<<<<<<<<<<<< [<<]+<+++++++++++++++>[>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push param# height=15
- <<<<<<<<<<<<<<<<<<<< [<<]+<+++++++++++++++>[>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push param# width=15
- <<<<<<<<<<<<<<<<<<<< [<<]+<> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push param# y=0
- <<<<<<<<<<<<<<<<<<<< [<<]+<> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push param# x=0
- <<<<<<<<<<<<<<<<<<<< [<<]+<+> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# circle
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# rect
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % step#6 rect!setWidth() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#6)
- %% make a function call: rect!setRadius(radius)
- <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get rect from slot#
- <<<<<<<<<<<<<<<<<<<< [<<]+ %% stack push param# radius=30
- <++++++++++++++++++++++++++++++>
- [>>]<< >>>>>>>>>>>>>>>>>>>>
- <<<<<<<<<<<<<<<<<<<< [<<]+<+++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# setRadius=30
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# rect
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % step#7 rect!draw() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+++++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#7)
- %% make a function call: rect!draw()
- <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get shape(0) from slot
- <<<<<<<<<<<<<<<<<<<< [<<]+<++++> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack push function# draw
- <<<<<<<<<<<<<<<<<<<< [<<]+<[-]> [>>]<< >>>>>>>>>>>>>>>>>>>> %% stack mark spot for object#
- [<<<<<<<<<<<<<<<<<<<< [<<]>+> [>>]<< >>>>>>>>>>>>>>>>>>>>-] %% stack push object# rect
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % step#8 exit() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++++++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#8)
- <<<<<<<<<<<<<<<<<<<< <<[-]>> >>>>>>>>>>>>>>>>>>>> %% kill stack to exit
- >]< %% END IF (function#99)
- >]< %% END IF (class#0)
- ================================================================================================
- = rectangle class =
- ================================================================================================
- [-]<<<[>>>+>+<<< <-]>>> >[<<< <+> >>>-]< %% get class#
- >[-]+ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (class#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#1 rectangle(x y width height) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#1)
- %% clear the slots
- <<<<[-]>>>> %% x=0
- <<<<<[-]>>>>> %% y=0
- <<<<<<[-]>>>>>> %% width=0
- <<<<<<<[-]>>>>>>> %% height=0
- %% grab the x value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<+>>>> >-]< %% set slot# x
- %% grab the y value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<+>>>>> >-]< %% set slot# y
- %% grab the width value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# width
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<<+>>>>>> >-]< %% set slot# width
- %% grab the height value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# height
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<<<+>>>>>>> >-]< %% set slot# height
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#2 moveTo(x y) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#2)
- %% grab the x value from the stack
- <<<<[-]>>>> %% x=0
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<+>>>> >-]< %% set slot# x
- %% grab the y value from the stack
- <<<<<[-]>>>>> %% y=0
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<+>>>>> >-]< %% set slot# y
- >]< %% END IF (function#2)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#3 rMoveTo(x y) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#3)
- %% grab the x value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<+>>>> >-]< %% set slot# x
- %% grab the y value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<+>>>>> >-]< %% set slot# y
- >]< %% END IF (function#3)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#5 setWidth(width) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#5)
- %% grab the width value from the stack
- <<<<<<[-]>>>>>> %% width=0
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# width
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<<+>>>>>> >-]< %% set slot# width
- >]< %% END IF (function#5)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#6 setHeight(height) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#6)
- %% grab the height value from the stack
- <<<<<<[-]>>>>>> %% height=0
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# height
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<<<+>>>>>>> >-]< %% set slot# height
- >]< %% END IF (function#5)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#4 draw() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#4)
- [-] #64# >++++++++[<++++++++>-]< ++++. %% D
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
- [-] #64# >++++++++[<++++++++>-]< +. %% A
- [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++++++. %% W
- [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++. %% N
- [-] #64# >++++++++[<++++++++>-]< +++++++. %% G
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< +. %% A
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
- [-] #64# >++++++++[<++++++++>-]< +++++. %% E
- [-] #64# >++++++++[<++++++++>-]< +++. %% C
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
- [-] #64# >++++++++[<++++++++>-]< +. %% A
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++. %% N
- [-] #64# >++++++++[<++++++++>-]< +++++++. %% G
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++. %% L
- [-] #64# >++++++++[<++++++++>-]< +++++. %% E
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< +. %% A
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
- [-] #30# >+++++++[<++++++++>-]< ++. %% :
- [-] #42# >++++++[<+++++++>-]< --. %% (
- [-] <<<<[>>>>+>+<<<< <-]>>>> [<<<< + >>>>-] %% x
- >[ %% output number
- [>+>+<<-]>>[<<+>>-]< %% dup
- >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
- >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
- [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
- >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
- >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
- <+> %% inc1
- ]
- <[
- [>+<-] %% mover
- +++++++[<+++++++>-]<-> %% add48
- <.[-]> %% putc
- >[<<+>>-]< %% movel2
- <-]
- [-]<<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get slot# x
- >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (x=0)
- [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
- >]< %% END IF (x=0)
- [-] #42# >++++++[<+++++++>-]< ++. %% comma
- [-] <<<<<[>>>>>+>+<<<<< <-]>>>>> [<<<<< + >>>>>-] %% y
- >[ %% output number
- [>+>+<<-]>>[<<+>>-]< %% dup
- >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
- >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
- [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
- >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
- >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
- <+> %% inc1
- ]
- <[
- [>+<-] %% mover
- +++++++[<+++++++>-]<-> %% add48
- <.[-]> %% putc
- >[<<+>>-]< %% movel2
- <-]
- [-]<<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get slot# y
- >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (y=0)
- [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
- >]< %% END IF (y=0)
- [-] #42# >++++++[<+++++++>-]< -. %% )
- [-] #42# >++++++[<+++++++>-]< ++. %% comma
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++++++. %% W
- [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
- [-] #64# >++++++++[<++++++++>-]< ++++. %% D
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
- [-] #64# >++++++++[<++++++++>-]< ++++++++. %% H
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> [<<<<<< + >>>>>>-] %% width
- >[ %% output number
- [>+>+<<-]>>[<<+>>-]< %% dup
- >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
- >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
- [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
- >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
- >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
- <+> %% inc1
- ]
- <[
- [>+<-] %% mover
- +++++++[<+++++++>-]<-> %% add48
- <.[-]> %% putc
- >[<<+>>-]< %% movel2
- <-]
- [-]<<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get slot# width
- >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (width=0)
- [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
- >]< %% END IF (width=0)
- [-] #42# >++++++[<+++++++>-]< ++. %% comma
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< ++++++++. %% H
- [-] #64# >++++++++[<++++++++>-]< +++++. %% E
- [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
- [-] #64# >++++++++[<++++++++>-]< +++++++. %% G
- [-] #64# >++++++++[<++++++++>-]< ++++++++. %% H
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] <<<<<<<[>>>>>>>+>+<<<<<<< <-]>>>>>>> [<<<<<<< + >>>>>>>-] %% width
- >[ %% output number
- [>+>+<<-]>>[<<+>>-]< %% dup
- >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
- >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
- [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
- >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
- >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
- <+> %% inc1
- ]
- <[
- [>+<-] %% mover
- +++++++[<+++++++>-]<-> %% add48
- <.[-]> %% putc
- >[<<+>>-]< %% movel2
- <-]
- [-]<<<<<<<[>>>>>>>+>+<<<<<<< <-]>>>>>>> >[<<<<<<< <+> >>>>>>>-]< %% get slot# height
- >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (height=0)
- [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
- >]< %% END IF (height=0)
- [-] ++++++++++.[-] %% \n
- >]< %% END IF (function#4)
- >]< %% END IF (class#2)
- ================================================================================================
- = circle class =
- ================================================================================================
- [-]<<<[>>>+>+<<< <-]>>> >[<<< <+> >>>-]< %% get class#
- >[-]++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (class#2)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#1 circle(x y radius) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#1)
- %% clear the slots
- <<<<[-]>>>> %% x=0
- <<<<<[-]>>>>> %% y=0
- <<<<<<[-]>>>>>> %% radius=0
- %% grab the x value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<+>>>> >-]< %% set slot# x
- %% grab the y value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<+>>>>> >-]< %% set slot# y
- %% grab the radius value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# radius
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<<+>>>>>> >-]< %% set slot# radius
- >]< %% END IF (function#1)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#2 moveTo(x y) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#2)
- %% grab the x value from the stack
- <<<<[-]>>>> %% x=0
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<+>>>> >-]< %% set slot# x
- %% grab the y value from the stack
- <<<<<[-]>>>>> %% y=0
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<+>>>>> >-]< %% set slot# y
- >]< %% END IF (function#2)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#3 rMoveTo(x y) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#3)
- %% grab the x value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# x
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<+>>>> >-]< %% set slot# x
- %% grab the y value from the stack
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# y
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<+>>>>> >-]< %% set slot# y
- >]< %% END IF (function#3)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#5 setRadius(radius) %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]+++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#5)
- %% grab the radius value from the stack
- <<<<<<[-]>>>>>> %% radius=0
- <[>+>+< <-]> >[< <+> >-]< %% get object#
- <[>[<<<<<<<<<<<<<<<<<<<< + >>>>>>>>>>>>>>>>>>>>-]< <<<<<<<<<<<<<<<<<<<<]> %% walk back to root object (drag object#)
- <<<<<<<<<<<<<<<<<<<< [<<] >> %% stack pull param# radius
- <[> [>>] << >>>>>>>>>>>>>>>>>>>> >+< <<<<<<<<<<<<<<<<<<<< [<<] >> <-]>
- [-]>> [>>] << >>>>>>>>>>>>>>>>>>>>
- [ %% walk to object#n (drag param# & object index)
- >[>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]<
- [>>>>>>>>>>>>>>>>>>>> + <<<<<<<<<<<<<<<<<<<< -]
- >>>>>>>>>>>>>>>>>>>>
- -]
- >[< <<<<<<+>>>>>> >-]< %% set slot# radius
- >]< %% END IF (function#5)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % function#4 draw() %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [-]<<[>>+>+<< <-]>> >[<< <+> >>-]< %% get function#
- >[-]++++ [<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (function#4)
- [-] #64# >++++++++[<++++++++>-]< ++++. %% D
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
- [-] #64# >++++++++[<++++++++>-]< +. %% A
- [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++++++. %% W
- [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++. %% N
- [-] #64# >++++++++[<++++++++>-]< +++++++. %% G
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< +. %% A
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< +++. %% C
- [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
- [-] #64# >++++++++[<++++++++>-]< +++. %% C
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++. %% L
- [-] #64# >++++++++[<++++++++>-]< +++++. %% E
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< +. %% A
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++++. %% T
- [-] #30# >+++++++[<++++++++>-]< ++. %% :
- [-] #42# >++++++[<+++++++>-]< --. %% (
- [-] <<<<[>>>>+>+<<<< <-]>>>> [<<<< + >>>>-] %% x
- >[ %% output number
- [>+>+<<-]>>[<<+>>-]< %% dup
- >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
- >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
- [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
- >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
- >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
- <+> %% inc1
- ]
- <[
- [>+<-] %% mover
- +++++++[<+++++++>-]<-> %% add48
- <.[-]> %% putc
- >[<<+>>-]< %% movel2
- <-]
- [-]<<<<[>>>>+>+<<<< <-]>>>> >[<<<< <+> >>>>-]< %% get slot# x
- >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (x=0)
- [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
- >]< %% END IF (x=0)
- [-] #42# >++++++[<+++++++>-]< ++. %% comma
- [-] <<<<<[>>>>>+>+<<<<< <-]>>>>> [<<<<< + >>>>>-] %% y
- >[ %% output number
- [>+>+<<-]>>[<<+>>-]< %% dup
- >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
- >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
- [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
- >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
- >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
- <+> %% inc1
- ]
- <[
- [>+<-] %% mover
- +++++++[<+++++++>-]<-> %% add48
- <.[-]> %% putc
- >[<<+>>-]< %% movel2
- <-]
- [-]<<<<<[>>>>>+>+<<<<< <-]>>>>> >[<<<<< <+> >>>>>-]< %% get slot# y
- >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (y=0)
- [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
- >]< %% END IF (y=0)
- [-] #42# >++++++[<+++++++>-]< -. %% )
- [-] #42# >++++++[<+++++++>-]< ++. %% comma
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] #64# >++++++++[<++++++++>-]< ++++++++++++++++++. %% R
- [-] #64# >++++++++[<++++++++>-]< +. %% A
- [-] #64# >++++++++[<++++++++>-]< ++++. %% D
- [-] #64# >++++++++[<++++++++>-]< +++++++++. %% I
- [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++++. %% U
- [-] #64# >++++++++[<++++++++>-]< +++++++++++++++++++. %% S
- [-] #30# >+++++[<++++++>-]< ++. %%
- [-] <<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> [<<<<<< + >>>>>>-] %% radius
- >[ %% output number
- [>+>+<<-]>>[<<+>>-]< %% dup
- >+++++++++<[>>>+<< [>+>[-]<<-] >[<+>-] %% mod10
- >[<<++++++++++>>-] <<- <-] +++++++++ >[<->-]<
- [>+<-] < [>+<-] < [>+<-] >>>[<<<+>>>-] < %% rrot
- >+++++++++< [ >>>+<< [>+>[-]<<-] >[<+>-] %% div10
- >[<<++++++++++>>>+<-] <<- <- ] >>>>[<<<<+>>>>-]<<<< >[-]<
- <+> %% inc1
- ]
- <[
- [>+<-] %% mover
- +++++++[<+++++++>-]<-> %% add48
- <.[-]> %% putc
- >[<<+>>-]< %% movel2
- <-]
- [-]<<<<<<[>>>>>>+>+<<<<<< <-]>>>>>> >[<<<<<< <+> >>>>>>-]< %% get slot# radius
- >[-][<->-]< >[-]< [>[-]+<-] >- [[-]< %% IF (radius=0)
- [-]>[-]+++++++[<+++++++>-]<-.[-] %% output 0 digit
- >]< %% END IF (radius=0)
- [-] ++++++++++.[-] %% \n
- >]< %% END IF (function#4)
- >]< %% END IF (class#2)
- <[<<<<<<<<<<<<<<<<<<<<]> %% walk back to root object
- <<<<<<<<<<<<<<<<<<<< <<]
- %%
- %% [ http://www.angelfire.com/tx4/cus/shapes/ ]
- %%
|