15 Nisan 2010 Perşembe
UYGULAMA 29 (Artilar)- 9 Nisan 2010
{Serdar'dan}
program pattern;
uses dos, crt, graph, printer;
var gs, gm : integer;
var xstart, ystart, rep, x, y, d, i, j :integer;
arti : array [1..24] of integer;
procedure articiz (x,y,d: word);
begin
arti[1]:=x; {x1}
arti[2]:=y; {y1}
arti[3]:=x+d; {2}
arti[4]:=y;
arti[5]:=x+d; {3}
arti[6]:=y-d;
arti[7]:=x+2*d; {4}
arti[8]:=y-d;
arti[9]:=x+2*d; {5}
arti[10]:=y;
arti[11]:=x+3*d; {6}
arti[12]:=y;
arti[13]:=x+3*d; {7}
arti[14]:=y+d;
arti[15]:=x+2*d; {8}
arti[16]:=y+d;
arti[17]:=x+2*d; {9}
arti[18]:=y+2*d;
arti[19]:=x+d; {10}
arti[20]:=y+2*d;
arti[21]:=x+d; {11}
arti[22]:=y+d;
arti[23]:=x; {12}
arti[24]:=y+d;
fillpoly (12, arti); {12 koseli ve arti dizinini kullanir}
end;
begin
gs:=detect;
initgraph (gs,gm,'c:\tp\bgi');
if graphresult <> grok then halt (1);
cleardevice;
setfillstyle (1,4);
xstart := 10; {baslangic x degeri}
ystart := -180; {baslangic y degeri}
rep := 40; {tekrar sayisi}
x := xstart;
y := ystart;
d := 15;
for i:=1 to rep do
begin
for j:=0 to rep do
begin
x := x+d*i*3;
y := y+d*i;
articiz (x,y,d);
x := xstart-d*j;
y := ystart+3*d*j;
end;
end;
readln;
closegraph;
end.
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder