home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / CNC11TP.ZIP / DEMOCIRC.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-01-19  |  1.5 KB  |  57 lines

  1. { Copyright (C) 1989 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
  2.  
  3. program StrokeCircleDemo ;
  4.  
  5.      {    StrokeCircle - draw circle of specified radius   }
  6.  
  7. uses GRAPH ;
  8.  
  9. {~~~~~~~~~~~~~~~~~~~~~ circle routines ~~~~~~~~~~~~~~~~~~~~}
  10.  
  11. {$I conic.pas }
  12.  
  13. {-$I circda2.pas  }
  14. {-$I circdaf.pas }
  15. {-$I circdai.pas }
  16. {-$I circdai2.pas }
  17. {-$I circdam2.pas }
  18. {-$I circdas.pas }              { note: disable leak test }
  19. {-$I circmb.pas }
  20. {$I circra.pas }
  21. {-$I circraf4.pas }
  22. {-$I circrai2.pas }
  23. {-$I circrair.pas }
  24. {-$I circram.pas }
  25. {-$I circras.pas }              { note: disable leak test }
  26.  
  27. {~~~~~~~~~~~~~~~~~~~~~ main program ~~~~~~~~~~~~~~~~~~~~~~~}
  28.  
  29. var
  30.    grDriver,grMode  : integer ; { graph control parameters }
  31.    r                : word ;    { circle radius }
  32.    xc, yc           : integer ; { circle center }
  33.  
  34. begin
  35.                                 { prompt for radius }
  36.    repeat
  37.       write ('Radius: ') ;
  38.       readln (r)
  39.    until (r > 0) ;
  40.                                 { initiate graphics }
  41.    grDriver := Detect ;
  42.    InitGraph(grDriver,grMode,'') ;
  43.                                 { center of display }
  44.    xc := (GetMaxX + 1) div 2 ;
  45.    yc := (GetMaxY + 1) div 2 ;
  46.                                 { draw circle }
  47.    StrokeCircle(xc,yc,r) ;
  48.                                 { leak test }
  49.    FloodFill(xc,yc,GetMaxColor) ;
  50.                                 { pause }
  51.    readln ;
  52.    CloseGraph
  53.  
  54. end.
  55.  
  56. { Copyright (C) 1989 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
  57.