; p> outtext (mes (z)); outtext (''); outtext (s); outtext ('року'); p> if (z mod 365) = 0 then tt: = 0; p> until key = true; p> closegraph; p> end; p> {****************************************** *****************} p> procedure komenu; p> var key: char; p> begin p> repeat p> key: = readkey; p> if (key = 'h') or (key = 'H') then p> begin p> herb; p> window (40,10,80,25); p> fon (black); p> clrscr; p> info; p> omenu; p> end; p> if (key = 'B') or (key = 'b') then p> begin p> beast; p> window (40,10,80,25); p> fon (black); p> clrscr; p> info; p> omenu; p> end; p> if (key = 'E') or (key = 'e') then p> begin p> env; p> window (40,10,80,25); p> fon (black); p> clrscr; p> info; p> omenu; p> end; p> until key = # 27; p> quit; p> CLRSCR; p> end; p> {****************************************** *****************} p> PROCEDURE GKMENU; p> var key2: char; p> key1: boolean; p> begin p> gmenu; p> info; p> repeat p> key2: = readkey; p> if (key2 = 's') or (key2 = 'S') then p> begin if (g> 0) and (m> 0) and (ttt> 0) and (tp> 0) and (tmin> 0) and (tmax> 0) p> and (ct> 0) and (ht> 0) and (hp> 0) and (hmin> 0) and (hmax> 0) and p> (Ch> 0) and (tree> 0) and (tr> 0) and (kata> 0) then p> begin p> start; gmenu; info; p> key1: = false; p> end; p> end; p> if (key2 = 'o') or (key2 = 'O') then p> begin p> Omenu; komenu; p> GMENU; p> info; key1: = false; p> end; p> if (key2 = 'q') or (key2 = 'Q') or (key2 = # 27) then p> begin p> key1: = true; quit; p> end; p> until key1 = true; p> end; p> {****************************************** *****************} p> {Body program} p> begin p> g: = 1200; {травоїдні кол-во} p> v: = 30; {вік травоїдного} p> m: = 200; {хижаки кол-во} p> w: = 25; {вік хижака} p> ct: = yellow; ch: = red; p> tmin: = 2; tmax: = 28; p> hmin: = 3; hmax: = 24; p> tp: = 3; hp: = 7; {дітородного} p> kata: = 9; ht: = 3; ttt: = 1; tree: = 1300; tr: = 15.1; p> hiddencursor; p> GKMENU; p> end. p> p> Додаток 2. p> p> Бібліотека Fauna1 p> p> {Init object} p> unit fauna1; p> interface p> uses graph; p> Type TPosition = object p> x, y: integer; p> procedure Init (x0, y0: integer); p> function getx: integer; p> function gety: integer; p> end; p> type Tosob = object (TPosition) p> color: word; p> vidno: boolean; p> AGE: INTEGER; p> constructor Init (x0, y0, age0: integer; col: word); p> destructor Done; virtual; p> procedure Show; virtual; p> procedure Blind; virtual; p> function Daizwet: word; p> function VidnoLi: boolean; p> FUNCTION DAIAGE: INTEGER; p> end; p> Posob = ^ Tosob; p> {metod Tposition} p> Implementation p> Procedure Tposition.Init (x0, y0: integer); p> Begin p> x: = x0; p> y: = y0; p> End; p> Function Tposition.Getx: integer; p> Begin GetX: = x End; p> Function Tposition.Gety: integer; p> Begin Gety: = y End; p> Constructor Tosob.Init (x0, y0, age0: integer; col: word); p> Begin p> Tposition.Init (x0, y0); p> AGE: = AGE0; p> color: = col; p> vidno: = ...