How to process a grid for amount of generations.
The demo has 2 generations and the following grids.
Starting Grid: [0, 0, 1, 0, 0, 0]
Generation 01: [0, 1, 0, 1, 0, 0]
Generation 02: [1, 0, 0, 0, 1, 0]
Final Grid : [1, 0, 0, 0, 1, 0]
- Load the
main.m
file and run it. - You should see the following information:
>> main
Running scripts...
Cellular Automaton with 2 generations and starting grid (size: 6) of:
0 0 1 0 0 0
Generation 1:
0 1 0 1 0 0
Generation 2:
1 0 0 0 1 0
Final result:
1 0 0 0 1 0
- See a JS implementation of the Game of Life.