home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l210 / 1.ddi / EXAMPLES.ARC / CH17EX02.PRO < prev    next >
Encoding:
Text File  |  1988-06-21  |  966 b   |  38 lines

  1. /*
  2.    Turbo Prolog 2.0 Chapter 17, Example Program 2
  3.    
  4.    Copyright (c) 1986, 88 by Borland International, Inc
  5.    
  6. */
  7.  
  8.  
  9. constants
  10. % To access your BGI drivers and fonts bgi_path may need to equal "..\\BGI".
  11.    bgi_path = ""
  12.  
  13. % To access the GRAPDECL.PRO file you may need to add a path: 
  14. % include "..\\programs\\GRAPDECL.PRO" 
  15. include "GRAPDECL.PRO" 
  16.  
  17. goal
  18.    initgraph(detect, 0, GraphDriver,GraphMode, bgi_path),
  19.  
  20.    /* Draw a 90 degree arc with radius of 50 */
  21.    arc(150, 150, 0, 89, 50),
  22.  
  23.    /* Get the coordinates of the arc and connect ends */
  24.    getarccoords(X,Y,XStart,YStart,XEnd,YEnd),
  25.    line(XStart, YStart, XEnd, YEnd),
  26.  
  27.    /* Draw a circle */
  28.    circle(150, 150, 100),
  29.  
  30.    /* Draw an ellipse inside the circle */
  31.    ellipse(150, 150, 0, 359, 100, 50),
  32.  
  33.    /* Draw and fill a pieslice */
  34.    pieslice(100, 100, 0, 135, 49),
  35.    pieslice(100, 100, 135, 225, 49),
  36.    pieslice(100, 100, 225, 360, 49),
  37.  
  38.    closegraph.