Enter the size of game of life grid
Enter number of rows
6
Enter number of columns
6
Now enter elements for Generation 1
0 for dead cell
1 for live cell
1 0 1 0 0 0
1 1 1 0 1 0
0 1 0 1 1 1
1 0 1 1 0 0
1 1 1 0 1 1
0 1 0 0 1 0
Generation 1:
---------------
1 0 1 0 0 0
1 1 1 0 1 0
0 1 0 1 1 1
1 0 1 1 0 0
1 1 1 0 1 1
0 1 0 0 1 0
---------------
Generation 2
1 0 1 1 0 0
1 0 0 0 1 1
0 0 0 0 0 1
1 0 0 0 0 0
1 0 0 0 1 1
1 1 1 1 1 1
---------------
Do you want to see next generation?
Enter Y for yes, N for no
Y
---------------
Generation 3
0 1 0 1 1 0
0 1 0 1 1 1
0 0 0 0 1 1
0 0 0 0 1 1
1 0 1 0 0 1
1 1 1 1 0 1
---------------
Do you want to see next generation?
Enter Y for yes, N for no
Y
---------------
Generation 4
0 0 0 1 0 1
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 1 0 0
1 0 1 0 0 1
1 0 1 1 1 0
---------------
Do you want to see next generation?
Enter Y for yes, N for no
N
GOOD BYE
^C