Question: In C programming please.. don't give me a wrong code or I will report you 2 The Game of Life (45 points) Imagine a world

In C programming please.. don't give me a wrong code or I will report you  In C programming please.. don't give me a wrong code or
I will report you 2 The Game of Life (45 points) Imagine
a world of organisms living in a two-dimensional cell grid size n

2 The Game of Life (45 points) Imagine a world of organisms living in a two-dimensional cell grid size n x m. Each organism can only occupy a single cell. Each cell, of world), has exactly eight neighboring cells (up, down, except those at the boundaries (the edge of the world left, right, and four diagonals). The cells at the boundaries have less than eight neighboring cells. The evolves from one generation to the other using the following rules 1. Any organism with fewer than two neighbors (a neighbor is an organism that lives in a neighboring cell) dies (out of loneliness 2. Any organism with more than three live neighbors dies (overcrowding). 3. Any organism with two or three live neighbors lives on to the next generation 4. Any vacant cell with exactly three live neighbors becomes occupied by a new organism (birth) Write a C program that plays the game of life. Your program should: 1. Read an initial world configuration from a file world.txt. The world is of size 10x10 2. Evolve the world to the next generation 3. Display the old and new world generation on screen. 4. Ask the user if he/she wants to continue evolution to the next generation 5. Display a message if the entire world is extinct. You should ignore the cells at the boundary of the world since the do not have enough neighbors to play the game. For a modular design, you should use the following functions: void read world (FILE *inp, int xl SIZE): //reads a world from a file to array x void print world(int x SIZE); prints world stored in array x on screen int evolve (int x[] SIZE), int row, nt col) returns the evolved cell value for cell x row] coll void copy world (int xl SIZE), int yl] SIZE); copies world in x to y int extinct x0 SIZE); returns a zero if all organisms are extinct (int Sample initial worlds are provided

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!