Ну и вот светофор: uses graphABC,crt; var x,y,a1,a2:real; i,x1,r,s,k:integer; m1:array [1..3] of integer; y1:array [1..3] of integer; begin x:=320; y:=240; r:=10; m1[1]:=clred; m1[2]:=clyellow; m1[3]:=clgreen; x1:=round(x); y1[1]:=round(y); y1[2]:=y1[1]+20; y1[3]:=y1[2]+20; SetBrushColor(clBlack); circle(x1,y1[1],r); circle(x1,y1[2],r); circle(x1,y1[3],r); while true do begin for i:=1 to 3 do begin SetBrushColor(m1); circle(x1,y1,r); if i=2 then Sleep(500) else Sleep(1500); SetBrushColor(clBlack); circle(x1,y1,r); end; end; end.
Begin
SetWindowSize(600,400);
line(250,100, 300,50);
lineto(350,100);
lineto(250,100);
floodfill(300,70, clgreen);
line(220,200, 300,100);
lineto(380,200);
lineto(220,200);
floodfill(300,150, clgreen);
line(200,300, 300,200);
lineto(400,300);
lineto(200,300);
floodfill(300,250, clgreen);
rectangle(290, 300,310, 320);
floodfill(300,305, clbrown);
line(0, 300, 100, 350);
lineto(200, 320);
lineto(400, 320);
lineto(600, 370);
lineto(600,400);
lineto(0,400);
lineto(0,300);
end.
Ну и вот светофор:
uses graphABC,crt;
var
x,y,a1,a2:real;
i,x1,r,s,k:integer;
m1:array [1..3] of integer;
y1:array [1..3] of integer;
begin
x:=320;
y:=240;
r:=10;
m1[1]:=clred;
m1[2]:=clyellow;
m1[3]:=clgreen;
x1:=round(x);
y1[1]:=round(y);
y1[2]:=y1[1]+20;
y1[3]:=y1[2]+20;
SetBrushColor(clBlack);
circle(x1,y1[1],r);
circle(x1,y1[2],r);
circle(x1,y1[3],r);
while true do begin
for i:=1 to 3 do begin
SetBrushColor(m1);
circle(x1,y1,r);
if i=2 then Sleep(500)
else Sleep(1500);
SetBrushColor(clBlack);
circle(x1,y1,r);
end;
end;
end.