subject

Java Program Assignment: Read in the size of an array from the user, then read in initial values into that array, accepting ONLY zeros and ones. To be more precise, any number not a zero should
be entered into the array as a one. Now proceed through 20 steps of a “cellular automata”,
where the rule to create one stage from the previous is:
1) If a cell has a "1" in it, and it is surrounded by two other "1"s, it dies (becomes a zero)
due to overcrowding.
2) If a cell has a “0” in it, and it is surrounded by two other "1Is, a new “1” is born there (as
a child of the two "1"s.
3) If a cell has a "1" in it, but is surrounded by zeros, it dies from starvation (or loneliness).
4) If a cell has a "0" in it, and one of its adjacent cells has a "1", then it becomes a “1” (think
of the spread of mold, or an increase in population of an animal).
5) If none of the rules above apply, the cell remains as it was.
6) Edge cells (the ones at the ends of the array) are treated as if the "missing" cell was a
zero.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:40, Tyrant4life
It is vital to research each of the services you plan to disable before implementing any change, especially on critical machines such as the: a. servers in the test environment. b. domain controller and other infrastructure servers. c. desktops that have previously been attacked. d. desktops used by upper-level management.
Answers: 2
image
Computers and Technology, 23.06.2019 16:30, isaiahhuettnerowgg8d
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
image
Computers and Technology, 24.06.2019 13:30, sweeps8758
Which type of excel chart should be used to track students’ progress on test grades? line column bar pie
Answers: 2
image
Computers and Technology, 24.06.2019 21:00, genyjoannerubiera
When replacing a thermostat or water pump, coolant drained from the cooling system should be
Answers: 1
You know the right answer?
Java Program Assignment: Read in the size of an array from the user, then read in initial values int...

Questions in other subjects:

Konu
Mathematics, 28.08.2020 01:01
Konu
Chemistry, 28.08.2020 01:01