>
-10 - br/>
Додаток 1.
Основна програма
program fauna;
uses mycrt, dos, graph, fauna1, tpcrt;
var p> q, x, y, x1, y1, gd, gm, t, i, j, k, AT, at1, ct1, ctp: integer; {загальні}
g, v, m, w: integer; {}
ct, ch: shortint; {колір}
tmin, tmax, hmin, hmax, tp, hp: integer; {дітородного}
tt: integer; {трупи і з'їдені травоїдні за 1 рік}
kata, ht: integer;
ttt, tr: real;
z, tree, TREE1: longint;
key: boolean;
s, ss: string [17];
tg: array [1 .. 4400] of tosob; {green-травоїдних}
hr: array [1 .. 1350] of tosob; {red-хижаків}
pal: FillPatternType;
{********************************************** *************}
procedure ini;
begin
for i: = 1 to g do
begin
at: = RANDOM (v) +1;
tg [i]. init ((random (630) +5), (random (462) +18), at, ct);
tg [i]. show;
end;
for i: = 1 to m do
begin
at: = random (w) +1;
HR [i]. Init ((random (630) +5), (random (462) +18), at, ch);
hr [i]. show;
end;
end;
{********************************************** *************}
procedure tnew;
begin
I: = 0;
REPEAT
I: = I +1;
begin
x: = tg [i]. getx;
y: = tg [i]. gety;
AT: = TG [I]. DAIAGE;
CTP: = TG [I]. DAIZWET;
if (z mod 365) = 0 then
BEGIN
at: = at +1; {Happy New Year!}
TG [I]. INIT (X, Y, AT, CTP);
END;
if at> v then {Old?}
begin
tg [i]. done;
-11 - br/>
tg [i]. init (0,0,0,0);
tt: = tt +1; {померле тварина}
for j: = i +1 to g do
begin
x1: = tg [j]. getx;
y1: = tg [j]. gety;
at1: = tg [j]. daiage;
ct1: = tg [j]. daizwet;
tg [j]. done;
tg [j-1]. init (x1, y1, at1, ct1);
tg [j-1]. show;
end;
TG [G]. INIT (0,0,0,0);
G: = G-1;
I: = I-1;
CONTINUE;
end;
x: = tg [i]. getx;
y: = tg [i]. gety;
x: = x + (random (3) -1);
y: = y + (random (3) -1);
if x <5 then x: = 6; if x> 635 then x: = 634; if y <17 then y: = 18;
if y> 480 then y: = 479;
AT: = TG [I]. DAIAGE;
CTP: = TG [I]. DAIZWET;
tg [i]. done;
IF CT <> 0 THEN
BEGIN
tg [i]. init (x, y, at, CTP);
tg [i]. show;
END;
END;
UNTIL I> = G;
end;
{********************************************** *************}
procedure trod;
begin
if (Z mod 365) = 0 then {Happy New Year!} p> begin
t: = 0;
for i: = 1 to g do
begin
at: = tg [i]. daiage;
if ...