Код
uses Crt, Graph;
const
RStart = 55
;
triangle: array[1..4] of pointtype=
((x:520; y:160), (x:500; y:200), (x:540; y:200), (x:520; y:160));
road: array[1..5] of pointtype=((x:10; y:480), (x:320; y:240),
(x:340; y:240), (x:80; y:480), (x:10; y:480));
procedure igruhki;
begin
setcolor(blue);
setfillstyle(1,red);
fillellipse(300,250,7,7);
setcolor(red);
setfillstyle(4,yellow);
fillellipse(200,420,7,7);
setcolor(green);
setfillstyle(7,lightblue);
fillellipse(400,420,7,7);
setcolor(yellow);
setfillstyle(1,blue);
fillellipse(330,170,7,7);
end;
procedure zemla;
begin
setfillstyle(1,black);
bar(0,0,640,240);
putpixel(2,2,white);putpixel(10,10,white);putpixel(500,150,white);
putpixel(40,40,white);putpixel(100,200,white);putpixel(600,200,white);
putpixel(344,30,white);putpixel(423,100,white);
setfillstyle(1,white);
bar(0,240,640,480);
setfillstyle(1,red);
bar(500,200,540,240);
fillpoly(4,triangle);
fillpoly(5,road);
end;
var
grDriver: Integer;
grMode: Integer;
ErrCode: Integer;
x, y, R: integer;
i, j: integer;
begin
grDriver := Detect;
InitGraph(grDriver, grMode,'');
ErrCode := GraphResult;
if ErrCode = grOk then
begin { Do graphics }
zemla;
setcolor(green);
for j := 2 to 6 do begin
y := (getmaxy div 10) * j;
R := RStart + 15*j;
for i := 1 to 5 do begin
arc((getmaxx div 2) - R, y, 350-(R div 5)-8*j, 359, R);
arc((getmaxx div 2) + R, y, 181, 190+(R div 5)+8*j, R);
inc(y, 7);
inc(R, 5);
end;
end;
setcolor(yellow);
settextstyle(sansseriffont,horizdir,7);
outtextxy(30,20,' Happy New Year!');
igruhki;
Readln;
CloseGraph;
end
else
Writeln('Graphics error:', GraphErrorMsg(ErrCode));
end.
const
RStart = 55
;
triangle: array[1..4] of pointtype=
((x:520; y:160), (x:500; y:200), (x:540; y:200), (x:520; y:160));
road: array[1..5] of pointtype=((x:10; y:480), (x:320; y:240),
(x:340; y:240), (x:80; y:480), (x:10; y:480));
procedure igruhki;
begin
setcolor(blue);
setfillstyle(1,red);
fillellipse(300,250,7,7);
setcolor(red);
setfillstyle(4,yellow);
fillellipse(200,420,7,7);
setcolor(green);
setfillstyle(7,lightblue);
fillellipse(400,420,7,7);
setcolor(yellow);
setfillstyle(1,blue);
fillellipse(330,170,7,7);
end;
procedure zemla;
begin
setfillstyle(1,black);
bar(0,0,640,240);
putpixel(2,2,white);putpixel(10,10,white);putpixel(500,150,white);
putpixel(40,40,white);putpixel(100,200,white);putpixel(600,200,white);
putpixel(344,30,white);putpixel(423,100,white);
setfillstyle(1,white);
bar(0,240,640,480);
setfillstyle(1,red);
bar(500,200,540,240);
fillpoly(4,triangle);
fillpoly(5,road);
end;
var
grDriver: Integer;
grMode: Integer;
ErrCode: Integer;
x, y, R: integer;
i, j: integer;
begin
grDriver := Detect;
InitGraph(grDriver, grMode,'');
ErrCode := GraphResult;
if ErrCode = grOk then
begin { Do graphics }
zemla;
setcolor(green);
for j := 2 to 6 do begin
y := (getmaxy div 10) * j;
R := RStart + 15*j;
for i := 1 to 5 do begin
arc((getmaxx div 2) - R, y, 350-(R div 5)-8*j, 359, R);
arc((getmaxx div 2) + R, y, 181, 190+(R div 5)+8*j, R);
inc(y, 7);
inc(R, 5);
end;
end;
setcolor(yellow);
settextstyle(sansseriffont,horizdir,7);
outtextxy(30,20,' Happy New Year!');
igruhki;
Readln;
CloseGraph;
end
else
Writeln('Graphics error:', GraphErrorMsg(ErrCode));
end.