[comp.sys.handhelds] ML Circles

CW%APG.PH.UCL.AC.UK@CUNYVM.CUNY.EDU (06/06/91)

         Lightning strikes, the ESD readings flicker momentarily, and
       a solitary dark cowelled figure is silouetted against the dungeon
       wall. He seems to be leaning over a small oblong object that you
       would estimate to be about 7'x3'x1' in size. With a blood curdling
       shriek he falls to the ground and seems to melt away into
       nothingnessnous leaving behind only his cowel and ... and ...
       a peice of paper lying on the floor by the cowel, you
       assume he must have been holding it in his hand afore his dreaded fate.
       Moving forward carefully you pick up the piece of paper, and upon
       examination you find it to be an incantation of sorts. You read on
       terror emptying into your heart with every word

            "  The following is a machine code routine to draw
               Circles quite quickly on the present PICT GROB.
               The GROB can be any size as the routine reads
               the size of the GROB itself. It is fairly robust -
               All plotting is kept within the GROB area. If
               PICT does not exist then it creates the default
               131x64 PICT. It does some very rudimentry arguament
               checking. (If anybody could send a quick tutorial
               on checking arguaments in system RPL to C.S.H I
               would be very grateful!). All in all it should
               work well, but if you have any problems let me
               know. When stored in the variable 'CIRCLE' it
               has the checksum #77c7h and takes up 305 bytes.
               It takes as arguaments

                          2:        { #x  #y }
                          1:                r

               where { #x #y } is the pixel coordinate of the
               centre of the circle (#x,#y are binary integers),
               and r is a real number representing the radius
               of the circle in pixels. Also included are two
               demonstration routines to give you a taste of
               what's possible. The ->ASC encoded version of
               'CIRCLE' follows
--------------------------------------------------------------------------------
%%HP: T(1)A(D)F(.);
"D9D20AEC81322302351566115CCD20A22008FD5F3081AF0B81AF028F1466081A
F048FB9760D281AF0881AF1C8AE606F90C6FA818F2281AF097D9081AF1980824
FFFF78B6E1818F2581AF10C4C4C281AF09613081AF1CCE81AF0C81AF10EAC4C4
818F0581AF19C281AF0981AF10E481AF0081AF1C8B2688A6607C108D34150D78
1AF13D876A08D341507F50C3C873907350C3E877807560C3C87B707950C3E87F
607F20E3C873607320E3E877507530E3C87B407920E3E87F3050081AF1BD581A
F1AD781AF1C81AF100181AF1BD581AF1AD781AF1881AF14011B5650714613416
E142D606CCDB8B257184146CED48B66616913207819F2819F2819F2E6C6CD480
CA68FFDBD5D680824300000EF4E58B0A0FCC50EF4819F3819F3CB1371430EF81
41010701B21307C77"
--------------------------------------------------------------------------------

               The two demonstration routines follow:-

               DEMO1 is
--------------------------------------------------------------------------------
%%HP: T(3)A(D)F(.);
\<<
    # 150d # 150d
      PDIM
      { # 0d # 0d } PVIEW
      0 149 FOR i
        i R\->B 75 R\->B 2 \->LIST i 75 - ABS CIRCLE
      3 STEP
\>>
--------------------------------------------------------------------------------

               DEMO2 is
--------------------------------------------------------------------------------
%%HP: T(3)A(D)F(.);
\<<
   { # 0d # 0d } PVIEW
   10 130 FOR i
     10 64 FOR j
       i R\->B j R\->B 2 \->LIST 10 CIRCLE
     10 STEP
   10 STEP
\>>
--------------------------------------------------------------------------------
               I hope this is clear and that some people
               find this useful. Please let me know your
               thoughts on how this routine could be improved.
               I for one am going to try and make it even faster!!!
               Thats all for now except for the disclaimer

               I accept no responsibility for anything done
               by this program constructive or destructive, but
               be warned, never ever on any account use this
               program in a damp dungeon where water may drop
               on your calculator and cause serious electric
               shock, or worse still damage it.

                          YOU HAVE BEEN WARNED!             "

         You notice the paper is rather grusomely charred, and
         there is the smell of ozone in the air. A thought enters
         your mind

              "I can't afford an HP48, and this bloke certainly
               won't be needing his anymore!"

         You turn and pick it up

         "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGH  ZAP SPLAT"

         As your body melts around you, you see the screen of the
         calculator and you notice with horror your death was in
         vain for on the screen are the words


               "GATEWAY


                     ENTER CODE"



                      :-)


            Conrad

CW%APG.PH.UCL.AC.UK@CUNYVM.CUNY.EDU (06/08/91)

     Hi everybody,

       My machine code routine has a couple of little bugs
      in it (I'm talking about the one that draws circles).

       i) Circles of zero radius are not positioned correctly
          on the screen.

      ii) If the number of pixels in the X-direction of the current
          PICT is exactly divisible by 8 then the circle are drawn
          wrongly.

        Neither of these causes problems too serious! i) is fixed
      and I know what is causing ii) but haven't mended it yet. I
      will post the debugged version soon.

           Thanks

            Conrad