home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 24 DOS / 24-DOS.zip / dosrx10b.zip / CIRCLE.R < prev    next >
Text File  |  1993-01-03  |  633b  |  29 lines

  1. /* ---------------- some mcga functions ---------------- */
  2. parse arg xc yc r .
  3. if xc = '' then do
  4.   say 'syntax: circle x y r'
  5.   exit 1
  6. end
  7.  
  8. call load "conio.r"
  9. call setmode x2d(13)
  10.  
  11. /* plot a multi color circle */
  12. call time 'r'
  13. do f = 0.0 to 6.28 by 0.025
  14.    x = xc + r * cos(f)
  15.    y = yc + r * sin(f)
  16.    call plot x,y,15
  17. end
  18. t = time('e')
  19. say "press enter to continue"
  20. pull .
  21. call setmode 3
  22. say "time to draw circle =" t "secs"
  23. exit
  24.  
  25. /* ------------- plot(x,y,color)--- returns prev color ---- */
  26. plot: procedure
  27. addr = "A0000"h + 320 * trunc(arg(2)) + trunc(arg(1))
  28. return storage(addr,1,d2c(arg(3)))
  29.