Procedure Art (X, Y: Integer; Angle1, Angle2, R: Word);
(X, Y) R Angle1 Angle2.
Procedure Bar (X1, Y1, X2, Y2: Integer);
, .
Procedure Circle (X, Y: Integer; R: Word);
(X, Y) R .
Procedure ClearDevice;
, , ( , , , ), (0, 0).
Procedure ClearViewPort;
(). , Palette(0), Bar (0, 0).
Procedure CloseGraph;
.
Procedure DetectGraph (var Driver, Mode: Integer);
, . Mode Driver, InitGraph . , Mode Driver -2.
, InitGraph DetectGraph, .
Function GetBkColor: Word;
.
Function GetColor: Word;
, SetColor.
Function GetDriverName: String;
InitGraph .
Function GetGraphMode: Integer;
, InitGraph SetGraphMode.
Function GetMaxX: Integer;
.
Function GetMaxY: Integer;
Y.
Function GetX: Integer;
.
Function GetY: Integer;
Y .
Procedure GraphDefaults;
. ( , , , , , ).
Function GetErrorMsg (ErrorCode: Integer): String;
|
|
(ErrorCode) , , .
Procedure InitGraph (var grDriver: Integer; var Mode: Integer; Path: String);
. grDriver ( ) Mode ( ) - (var). grDriver Detect, DetectGraph, .
Procedure Line (X1, Y1, X2, Y2: Integer);
(X1, Y1) (X2, Y2).
Procedure Rectangle (X1, Y1, X2, Y2: Integer);
, . (X1, Y1) , (X2, Y2) .
Procedure SetColor (Color: Word);
, Color.
Procedure SetGraphMode (Mode: Integer);
.
Procedure SetLineStyle (SType: Word; Pattern: Word; S: Word);
S SType.
Procedure SetTextJustify (Goriz, Vert: Word);
, OutText OutTextXY.
Program lines;
Uses Graph, Crt; { }
Const
grDriver: integer = Detect;
size = 40;
s2 = size div 2;
s4 = size div 4;
Var
grMode, ErrCode, Halfx, Halfy
x, y, x1, y1, x2, y2, i: integer;
begin
randomize;
{- - - - - - - - - - - - - - - - -}
InitGraph (grDriver, grMode, d:\tp\bgi); { }
ErrCode:= GraphResult;
{ }
if ErrCode <> GrOk then begin
writeln ( :', GraphErrorMsg(ErrCode));
exit end;
{- - - - - - - - - - - - - - - - -}
Halfx:= GetMaxX div 2; { }
Halfy:= GetMaxY div 2;
x:= Halfx;
x1:= x;
y:= Halfy;
y1:= y;
for i:= 1 to 450 do begin { }
x2:= round(cos(0.05*i)* Halfy) + Halfx;
y2:= round(sin(0.05*i)* Halfy) + Halfy;
if (i mod 10) = 0 then SetColor(random(15)+1);
Line(x1, y1, x2, y2);
Line(x, y, x2, y2);
x1:= x2;
y1:= y2;
delay (5);
end;
CloseGraph { }
end.
: Graph.
1, 11 | ( ). |
2, 12 | . |
3, 13 | (----) . |
4, 14 | ( ). |
5, 15 | . |
6, 16 | ( : -- ). |
7, 17 | ( , ). |
8, 18 | . |
9, 19 | . |
10, 20 | ( 5 ). |
:
|
|
1. Graph.
2. Graph.
3. Graph.
4. Graph.
, , , Graph.