( RobTasks)

200 VARIABLE radius
500 VARIABLE y
20 VARIABLE dx
addrmode 4 + @ 3 2 */ CONSTANT xshape
addrmode 8 + @ 3 2 */ CONSTANT yshape

( Moving circle as one task)
: movecircle
  40 0 DO   y @ ( 1750) yshape DO 255 128 0 use_colour
            ( 2500) xshape  I radius @ CIRCLE 2 Tdelay_p dx @ 2* NEGATE +LOOP
            0 0 128 use_colour 
            ( 2500) xshape radius @ - ( X) y @ radius @ - ( Y)
            radius @ 2* ( dx) ( 1700) yshape 50 - ( dy) RECTANGLE-FILL  ( wipe display)
       LOOP ;


: movesquare
   20 0 DO ( 1750) yshape y @ radius @ - DO  0 128 255 use_colour
             ( 2000) xshape 500 - I radius @ DUP RECTANGLE 2 Tdelay_p dx @ +LOOP
             0 0 128 use_colour 
             ( 2000) xshape 500 -  ( X) y @ radius @ -  ( Y)
             radius @  ( dx) ( 1600) yshape 50 - ( dy) RECTANGLE-FILL  ( wipe display)
         LOOP ;


