Question: 4. Game of Life (5 marks), coding style (1 mark) Write a gameoflife (x_cycle) function to simulate the game of life based on a

4. Game of Life (5 marks), coding style (1 mark) Write a gameoflife (x_cycle) function to simulate the game of life based on a given initial population, origin, represented as a list of lists and returns the final population (list) after x_cycle number of cycles. Please refer to the Wikipedia page on Game of Life at https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life and read the sections headed "Rules" and "Examples of patterns". For a cell on the edge of the world, the neighbours outside the world are considered dead. In the end, return final population (the list). Make sure to only return the list and nothing else is printed. Name the file for this program as cwk1d.py. origin = [[0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 01, [0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 01, [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 11, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0], 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, [0, 0, 0, *in python [0, 0, 0, 0, [1, 1, 1, 0, [0, 0, 0, 0, [0, 0, 0, 0, [0, 0, 0, 0, [0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, [0, 1, 1, 0, 0, [1, 1, 1, 1, 0, [1, 1, 0, 1, 1, [0, 0, 1, 1, 0, [0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 0, 0, 01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 01, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 01, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 0, 0, 0, 0, 0], 0, 0, 0, 0, 0, 0], 0, 0, 0, 0, 0, 0], 0, 0, 0, 0, 0, 0, 0, 0, 0, 01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 0, 0, 0, 0, 0, 0, 0, 0, 0, 01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 011
Step by Step Solution
There are 3 Steps involved in it
Answer Here is a simple Java implementation of the Game Of Life Grid is initialized with 0s represen... View full answer
Get step-by-step solutions from verified subject matter experts
