home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / TURBO.ZIP / CIRCDEMO.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1983-01-08  |  569 b   |  25 lines

  1. (* procedure for drawing a circle *)
  2. procedure drawcircle(x1,y1,r: integer);
  3.    var temp,x,z : integer;
  4.    begin
  5.    z := x1-r;
  6.    for x := z to x1 do
  7.    begin
  8.      temp := y1-trunc(sqrt(r*r-(x1-x)*(x1-x)));
  9.      gotoxy(x*2,temp); write('a');
  10.      gotoxy(x*2,2*y1-temp); write('b');
  11.      gotoxy((2*x1-x)*2,temp); write('c');
  12.      gotoxy((2*x1-x)*2,2*y1-temp); write('d');
  13.    end;
  14.    end;
  15. begin
  16.    clrscr;
  17.    drawcircle(20,12,1);
  18.    drawcircle(20,12,5);
  19.    drawcircle(20,12,10);
  20.    drawcircle(5,18,3);
  21.    drawcircle(5,5,3);
  22.    delay(3000);
  23. end.
  24.  
  25.