We can use a two-dimensional square array to implement the game. Each cell in the array holds either * or a blank2. The asterisk represents the presence of an organism, the blank its absence. The game starts with an initial generation, which consists of any
mix of asterisks and blanks; the game, however, becomes interesting only with certain mixes.
Three rules govern the transition from one generation to the next:
a) Birth Rule: An organism is born into any empty cell that has exactly three living neighbours.
b) Survival Rule: An organism with either two or three living neighbours survives from one generation to the next.
c) Death Rule: An organism with four or more neighbours dies from overcrowding. An organism with fewer than two neighbours dies from loneliness.
A neighbour of a cell c is any cell that touches c (this includes all cells that are vertically,horizontally and diagonally adjacent to the cell). A cell that does not lie on the edge has exactly eight neighbors. A cell on the edge has either five or three neighbours depending on where it is located.3
Corner cells (3 neighbours) – and even other edge cells (5 neighbours) – are vulnerable, and they
are less likely to be born.
If we produce many generations, interesting behaviour of the population becomes possible. . The initial configuration
returns after four cycles, but moved one cell down and right.
Program – its top-level procedure – will have a few obvious parameters:
the size of the array;
the character for the live cells;
the number of generations to produce;
the initial configuration randomly generated.
The program will print the required number of generations. Make it simple "ASCII art".
Program in a style that fits Scheme: bottom-up and in modular fashion. Every procedure does something fairly simple, and naturally it checks the correctness of its arguments; it has a "wrapper" to separate the core operation from the correctness test. Keep procedures local as much as possible. Make them as generic as possible
Exactly I am looking for "Game of life" in scheme language. Output format would preffered in the console but a .txt file output for all generation is fine. Intial confuguaration should be random(with user input being how many living cells), Finally if wrong arguments are provided it should spit out an error.
So the following query
generation(#of generation # of intial living organisms m n character of living cell)
generation( 10 5 4 4 *)
In this case:
Number of generations:10
Number of intial living organisms: 5
Array size 4X4
17 freelanceria on tarjonnut keskimäärin 99 $ tähän työhön
I you need it in java , i will be right person for it, java is can be run on any platform, also it will easy to understand the code and implementation of it in java.