|
i have a problem whith cellualar automata
Implement a cellular automaton with the following rules
based on the four-neighbors of a cell:
1. A white cell becomes black if the number of its black neighbors is not 1;
2. A black cell stays black if the number of its black neighbors is either 1 or 3:
3. Otherwise, the cell becomes white.
Starting from a single black cell at the center of the board,
Use a Timer object to animate the process,
and allow the user to stop the animation by a mouse click.
|