program grafica;
uses crt, graph;
const
k = 150; {dlina lucha (iznachal'nogo)}
n = 8; {kolichestvo luchei}
g = 4; {glubina rekursii}
var
gd, gm: integer;
label menu;
procedure Snezhinka_v_zh (x, y: word; r, c: byte);
var alpha: real;
i: byte;
xd, yd: integer;
begin
if c < 1 then exit;
for i := 1 to n do
begin
alpha := 2 * Pi * i / n;
xd := round(x + r * cos(alpha));
yd := round(y + r * sin(alpha));
moveto(x, y);
lineto(xd, yd);
Snezhinka_v_zh(xd, yd, r div 4, c - 1);
end;
end;
begin
initgraph(gd, gm, 'C:\tp7\bgi');
setcolor(11);
snezhinka_v_zh(320,240, k,g);
var
m:integer;
menu:
clrscr;
outtextxy(250,10,'Grafica');
outtextxy(180,30, '1. Risovanie snejinki');
outtextxy(180,50, '2. Risovanie okrujnostei');
outtextxy(180,70, '3. Risovanie smaila');
outtextxy(180,90, '4. Risovanie Vody');
outtextxy(180,110, '5. Vixod');
outtextxy(180,130, 'Vvedite nomer pynkta i najmite <Enter>: ' );
readln(m);
case m of
1:Snezhinka_v_zh;
2:{Okrujnost;}
3:{Elips; }
4:{kvadrat ; }
5:{halt ; }
{end;}
outtext('Dlya vixoda v menu najmite <Enter>');
readln;
goto menu;
readkey;
closegraph;
end.
меню |