g> 4000 then break;
if keypressed then key: = true;
if (g> 4000) or (g <= 0) or (m <= 0) or (m> 1000) then
key: = true;
setcolor (white);
bar (0,0,640,17);
moveto (0,0);
outtext ('Травоїдні Хижаки З'їдено
Трава Рік ');
setcolor (ct); moveto (0,10); str (g, s); outtext (s);
setcolor (ch); moveto (175,10); str (m, s); outtext (s);
setcolor (red); moveto (300,10); str (tt, s); outtext (s);
setcolor (green); moveto (400,10); str ((tree), s); outtext (s);
setcolor (magenta); moveto (510,10); str ((z div 365), s);
outtext (mes (z)); outtext (' '); Outtext (s); outtext (' року ');
if (z mod 365) = 0 then tt: = 0;
until key = true;
closegraph;
end;
{********************************************** *************}
procedure komenu;
var key: char;
begin
repeat
key: = readkey;
if (key = 'h') or (key = 'H') then
begin
herb;
window (40,10,80,25);
fon (black);
clrscr;
info;
omenu;
end;
if (key = 'B') or (key = 'b') then
begin
beast;
window (40,10,80,25);
fon (black);
clrscr;
info;
omenu;
end;
if (key = 'E') or (key = 'e') then
begin
env;
window (40,10,80,25);
fon (black);
-23 - br/>
clrscr;
info;
omenu;
end;
until key = # 27;
quit;
CLRSCR;
end;
{********************************************** *************}
PROCEDURE GKMENU;
var key2: char;
key1: boolean;
begin
gmenu;
info;
repeat
key2: = readkey;
if (key2 = 's') or (key2 = 'S') then
begin
if (g> 0) and (m> 0) and (ttt> 0) and (tp> 0) and (tmin> 0) and (tmax> 0)
and (ct> 0) and (ht> 0) and (hp> 0) and (hmin> 0) and (hmax> 0) and
(Ch> 0) and (tree> 0) and (tr> 0) and (kata> 0) then
begin
start; gmenu; info;
key1: = false;
end;
end;
if (key2 = 'o') or (key2 = 'O') then
begin
Omenu; komenu;
GMENU;
info; key1: = false;
end;
if (key2 = 'q') or (key2 = 'Q') or (key2 = # 27) then
begin
key1: = true; quit;
end;
until key1 = true;
end;
{********************************************** *************}
{Body program}
begin
g: = 1200; {травоїдні кол-во}
v: = 30; {вік травоїдного}
m: = 200; {хижаки кол-во}
w: = 25; {вік хижака}
ct: = yellow; ch: = red;
tmin...