subject
Computers and Technology, 08.11.2019 20:31 rina62

Java ap csa
lab assignment ab23.1
life
background:
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:
1. a “neighbor” of a cell is defined as any cell touching that cell. for example, the eight blue cells
in the diagram are the neighbors of the cell in the middle.
2. every empty cell with three living neighbors will come to life in the next generation (termed a
“birth”).
3. any cell with one or zero neighbors will die of loneliness, while any cell with four or more
neighbors will die from overcrowding (termed a “death”).
4. any cell with two or three neighbors will live into the next generation (no change).
5. all births and deaths occur simultaneously.
assignment:
1. write a program that implements the game of life. the size of the grid will be a square 20 x
20.
2. the original grid of bacteria will be supplied to your program from a text file (life100.txt).
a. the first line will contain the number (n) of bacteria locations in the file.
b. what follows are n pairs of data, one pair of numbers per line.
c. the first value of each line indicates the row location while the second value on the
line indicates the column location.
d. the data file values are given as: 1 < = row < = 20 and 1 < = col < = 20.
3. after your program has initialized the grid with generation 0, your program must allow life to
proceed for 5 generations.
4. display the final results on the screen and determine the following statistical information:
a. the number of living cells in row 10.
b. the number of living cells in column 10.
c. the number of living cells in the entire board.
instructions:
1. a sample run output is given below. note, these are the correct answers if you use the
provided data file "life100.txt".

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:00
The fourth generation of computers emerged between 1970s and 1980s. which technological advancement brought about this generation of computers? which computer architecture was used most in this generation?
Answers: 3
question
Computers and Technology, 23.06.2019 13:00
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
You know the right answer?
Java ap csa
lab assignment ab23.1
life
background:
the “game of life” is a...
Questions
question
Social Studies, 01.12.2021 20:00