The “Game of Life” is a computer simulation of the life and death events of a population of bacterial organisms. This program will determine the life, death, and survival of bacteria from one generation to the next, assuming the starting grid of bacteria is considered generation zero. The rules for the creation of the next generation are as follows:
-
Write a program that implements the game of Life. The size of the grid will be a square 20 x 20.
-
The original grid of bacteria will be supplied to your program from a text file (life100.txt).
-
The first line will contain the number (N) of bacteria locations in the file.
-
What follows are N pairs of data, one pair of numbers per line.
-
The first value of each line indicates the row location while the second value on the line indicates the column location.
-
The data file values are given as: 1 <= Row <= 20 and 1 <= Col <= 20.
After your program has initialized the grid with generation 0, your program must allow Life to proceed for 5 generations.
Display the final results on the screen and determine the following statistical information:
The number of living cells in row 10.
The number of living cells in column 10.
The number of living cells in the entire board.