diff --git a/program-for-conways-game-of-life b/program-for-conways-game-of-life new file mode 100644 index 00000000..3f5d73a7 --- /dev/null +++ b/program-for-conways-game-of-life @@ -0,0 +1,115 @@ +#include +#include + +//change row and column value to set the canvas size +int row = 5; +int col = 4; + +//creates row boundary +int row_line(){ + printf("\n"); + for(int i=0; i=row || j>=col)){ + continue; + } + if(a[i][j]==1){ + count++; + } + } + } + return count; +} + +int main(){ + int a[row][col], b[row][col]; + int i,j; + int neighbour_live_cell; + + //generate matrix canvas with random values (live and dead cells) + for(i=0; i