15 Nisan 2010 Perşembe
UYGULAMA 28 (Cokgenler) - 2 Nisan 2010
PROGRAM COKGENLER;
USES CRT, DOS, GRAPH, PRINTER;
VAR GRAFIKSURUCU, GRAFIKKONUMU,i,j:INTEGER;
ALTIGEN: ARRAY[1..12] OF INTEGER;
PROCEDURE ALTIGENCIZ (X,Y,L :WORD);
VAR X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6 :INTEGER;
BEGIN
ALTIGEN [1]:= X;
ALTIGEN [2] := Y;
ALTIGEN [3]:= X+L;
ALTIGEN [4]:= Y;
ALTIGEN [5] := ALTIGEN[3]+ L DIV 2;
ALTIGEN [6]:= Y- ROUND(SQRT (3) *L /2);
ALTIGEN [7]:= ALTIGEN [3];
ALTIGEN [8]:= Y- ROUND(SQRT (3) *L);
ALTIGEN [9]:= X;
ALTIGEN [10]:= Y- ROUND(SQRT (3) *L);
ALTIGEN [11]:= X- L DIV 2;
ALTIGEN [12]:= Y- ROUND(SQRT (3) *L /2);
SETCOLOR(6);
SETFILLSTYLE(3,9);
FILLPOLY (6,ALTIGEN);
END;
BEGIN
GRAFIKSURUCU:=DETECT;
INITGRAPH (GRAFIKSURUCU, GRAFIKKONUMU,'C: \TP\BGI');
IF GRAPHRESULT<>GROK THEN HALT(1);
CLEARDEVICE;
FOR i :=1 TO 15 DO
BEGIN
FOR j := 1 TO 20 DO
BEGIN
ALTIGENCIZ (i*40 ,j* 40,30-i-j);
END;
END;
READLN;
CLOSEGRAPH;
END.
Kaydol:
Kayıt Yorumları (Atom)
Hiç yorum yok:
Yorum Gönder