ure dead; {хижаки едеят в радіусі 1 піксель}
begin
for i: = 1 to m do
begin
x: = hr [i]. getx;
y: = hr [i]. gety;
j: = 0;
repeat
j: = j +1;
-14 - br/>
x1: = tg [j]. getx;
y1: = tg [j]. gety;
if ((x = x1) and (y = y1)) or ((x = x1) and (y = y1-1)) or ((x = x1)
and (y = y1 +1)) or ((x = x1-1) and (y = y1)) or ((x = x1-1) and (y = y1-1))
or ((x = x1-1) and (y = y1 +1)) or ((x = x1 +1) and (y = y1)) or ((x = x1 +1) and
(y = y1-1)) or ((x = x1 +1) and (y = y1 +1)) then
begin
tg [j]. done;
tg [j]. init (0,0,0,0);
tt: = tt +1;
k: = j;
repeat
k: = k +1;
x1: = tg [k]. getx;
y1: = tg [k]. gety;
at1: = tg [k]. daiage;
ct1: = tg [k]. daizwet;
tg [k]. done;
tg [k-1]. init (x1, y1, at1, ct1);
tg [k-1]. show;
until k> = g;
TG [G]. INIT (0,0,0,0);
G: = G-1;
j: = j-1;
end
else
begin
end;
until j> = g;
end;
end;
{********************************************** ************}
procedure havka;
begin
if ((Z mod 365) = 0) and (tt> 0) then
begin
x1: = (tt div ht); {скільки прогодуватися в цьому році}
j: = 0;
y1: = w; {max vozrast}
if x1 = 0 then
begin
for i: = 1 to m do
begin
hr [i]. init (0,0,0,0);
hr [i]. done;
end;
end;
if (x1 0) then
begin
repeat
j: = j +1;
if hr [j]. daiage = y1 then
begin
hr [j]. done;
hr [j]. init (0,0,0,0);
for i: = j +1 to m do
-15 - br/>
begin
x: = hr [i]. getx;
y: = hr [i]. gety;
at1: = hr [i]. daiage;
ct1: = hr [i]. daizwet;
hr [i]. done;
hr [i-1]. init (x, y, at1, ct1);
HR [i-1]. Show;
end;
hr [m]. init (0,0,0,0);
m: = m-1;
if m <= 0 then
begin
key: = true;
break;
end;
end;
if j> = m then
begin
j: = 0;
y1: = y1-1;
end;
if m <= 0 then break;
until x1 = m
end;
end;
end;
{********************************************** *************}
procedure tmor; {мор травоїдних}
begin
y: = g-x;
if x> 0 then
begin
repeat
j: = random (g) +1;
tg [j]. done;
tg [j]. init (0,0,0,0);
tt: = tt +1;
for i: = j +1 to g do
begin
x1: = tg [i]. getx;
y1: = tg [i]. gety;
at1: = tg [i]. daiage;
ct1: = tg [i]. daizwet;
tg [i]. done;
tg [i-1]. init (x1, y1, at1, ct1);
...