-- FILE: life2.adb -- AUTHOR: E.Burke -- DATE: November, 1996 -- PURPOSE: Driver procedure for Game of Life with Grid2; procedure Life2 is RMAX : constant POSITIVE := 20; CMAX : constant POSITIVE := 50; SMAX : constant POSITIVE := 50; MARK : constant CHARACTER := '*'; -- Package GRID contains generic specification of BOARD and all -- operations needed to play the Game of Life package Life_Grid is new GRID2 (MAX_ROWS => RMAX, MAX_COLUMNS => CMAX, MAX_SIZE => SMAX, MARK_TYPE => MARK); T : Life_Grid.BOARD; begin Life_Grid.Initialize(T); -- Set all cells to 'dead' (false) Life_Grid.Input(T); -- Allow user to input coordinates -- of 'alive' cells Life_Grid.Output (T); -- Display cells (initial pattern) loop exit when not Life_Grid.Enquire; Life_Grid.Update_Box (T); -- Change cells to alive or dead depending -- on status of neighbors Life_Grid.Output (T); -- Display cells (updated pattern) end loop; end Life2;