program lines; uses graph, crt; const grDriver : integer = Detect; size = 40; s2 = size div 2; s4 = size div 4; margin = 40; var grMode : integer; ErrCode : integer; HalfX, HalfY : integer; x, y, x1, x2, y1, y2, i : integer; image : pointer; begin randomize; InitGraph (grDriver, grMode, 'd:\bp\bgi'); ErrCode:= GraphResult; if ErrCode <> GrOk then begin writeln('Error Grafic: ' , GraphErrorMsg(ErrCode)); exit end; HalfX := GetMaxX div 2; HalfY := GetMaxY div 2; X := HalfX; x1 := x; Y := HalfY; y2 := y; for i := 1 to 450 do begin x2 := round(cos(0.05*i) * HalfY) + HalfX; y2 := round(sin(0.02*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; SetColor(Cyan); x:= margin; y:=x; Circle(x + s2, y + s2, s2); SetFillStyle (InterLeaveFill, Green); FillEllipse(x + s4, y + s4, s4, s4 div 2); FillEllipse(x + 3 * s4, y + s4, s4, s4 div 2); SetLineStyle (SolidLn, 0, ThickWidth); Line(x + s2, y + s4, x + s2, y + s2); SetColor(Red); Arc(x + s2, y + s2, 200, 340, s4); Getmem (image, imagesize(x, y, x + size, y + size)); GetImage (x, y, x + size, y + size, image^); PutImage(x, y, image^, XorPut); while x < GetMaxX - margin - size do begin PutImage(x, y, image^, XorPut); delay(20); PutImage(x, y, image^, XorPut); inc(x, 5); end; PutImage(x, y, image^, XorPut); SetColor(Cyan); SetTextStyle (GothicFont, HorizDir, 4); OutTextXY (HalfX + margin, HalfY - margin, 'The end'); readln; CloseGraph end.