PROGRAM UCGENLER; USES CRT, DOS, GRAPH, PRINTER; VAR GRAFIKSURUCU, GRAFIKKONUMU,i:INTEGER;
BIRX: ARRAY [1..20] OF INTEGER; BIRY: ARRAY [1..20] OF INTEGER; IKIX: ARRAY [1..20] OF INTEGER; IKIY: ARRAY [1..20] OF INTEGER; UCX: ARRAY [1..20] OF INTEGER; UCY: ARRAY [1..20] OF INTEGER;
PROCEDURE UCGENCIZ (X1,Y1,X2, Y2, X3,Y3 :INTEGER); BEGIN LINE(X1,Y1,X2,Y2); LINE(X2,Y2,X3,Y3); LINE(X3,Y3,X1,Y1);
FOR i:=1 TO 5 DO BEGIN BIRX[i]:= X1+(X2-X1) DIV 5 *i; BIRY[i]:= Y1+(Y2-Y1) DIV 5 * i;
IKIX[i]:= X2+(X3-X2) DIV 5 *i; IKIY[i]:= Y2+(Y3-Y2) DIV 5 * i;
UCX[i]:= X3+(X1-X3) DIV 5 *i; UCY[i]:= Y3+(Y1-Y3) DIV 5 * i;
END;
END;
BEGIN GRAFIKSURUCU:=DETECT; INITGRAPH (GRAFIKSURUCU, GRAFIKKONUMU,'C:\PROGRA~1\TP\BGI'); IF GRAPHRESULT<>GROK THEN HALT(1); CLEARDEVICE;
setcolor (7); UCGENCIZ (50,50,450,400,50,300);
FOR i:=1 TO 5 DO BEGIN LINE (BIRX[i], BIRY[i], IKIX[i], IKIY[i]); LINE (BIRX[i], BIRY[i], UCX[i], UCY[i]); LINE (UCX[i], UCY[i], IKIX[i], IKIY[i]); {LINE(BIRX[RANDOM(5)+1], BIRY[(RANDOM(5)+1)], IKIX[2], IKIY[2]} END;
PROGRAM UCGENLER;
YanıtlaSilUSES CRT, DOS, GRAPH, PRINTER;
VAR GRAFIKSURUCU, GRAFIKKONUMU,i:INTEGER;
BIRX: ARRAY [1..20] OF INTEGER;
BIRY: ARRAY [1..20] OF INTEGER;
IKIX: ARRAY [1..20] OF INTEGER;
IKIY: ARRAY [1..20] OF INTEGER;
UCX: ARRAY [1..20] OF INTEGER;
UCY: ARRAY [1..20] OF INTEGER;
PROCEDURE UCGENCIZ (X1,Y1,X2, Y2, X3,Y3 :INTEGER);
BEGIN
LINE(X1,Y1,X2,Y2);
LINE(X2,Y2,X3,Y3);
LINE(X3,Y3,X1,Y1);
FOR i:=1 TO 5 DO
BEGIN
BIRX[i]:= X1+(X2-X1) DIV 5 *i;
BIRY[i]:= Y1+(Y2-Y1) DIV 5 * i;
IKIX[i]:= X2+(X3-X2) DIV 5 *i;
IKIY[i]:= Y2+(Y3-Y2) DIV 5 * i;
UCX[i]:= X3+(X1-X3) DIV 5 *i;
UCY[i]:= Y3+(Y1-Y3) DIV 5 * i;
END;
END;
BEGIN
GRAFIKSURUCU:=DETECT;
INITGRAPH (GRAFIKSURUCU, GRAFIKKONUMU,'C:\PROGRA~1\TP\BGI');
IF GRAPHRESULT<>GROK THEN HALT(1);
CLEARDEVICE;
setcolor (7);
UCGENCIZ (50,50,450,400,50,300);
FOR i:=1 TO 5 DO
BEGIN
LINE (BIRX[i], BIRY[i], IKIX[i], IKIY[i]);
LINE (BIRX[i], BIRY[i], UCX[i], UCY[i]);
LINE (UCX[i], UCY[i], IKIX[i], IKIY[i]);
{LINE(BIRX[RANDOM(5)+1], BIRY[(RANDOM(5)+1)], IKIX[2], IKIY[2]}
END;
READLN;
CLOSEGRAPH;
END.