Can anyone help me implement Conway’s Game of Life in Python? Just to clarify, this is homework, although I believe I am not violating the rules because I am not asking for answers, just help on certain sections. Here are the rules: Wikipedia Link

First, I have separated the game into six (6) functions to organize my code and make it easier for me to implement.

Function 1: create a blank grid

input: nothing

return: a blank grid

Function 2: print a given grid

input: a grid

return: nothing

Function 3: load a pattern

input: a file name, a grid

return: nothing

Function 4: advance a grid one generation

input: a grid

return: a new grid advanced by one generation

Function 5: advance a cell one generation

input: a row, a column, a grid

return: whether the cell is alive or not (True or False)

Function 6: determine the number of living neighbors of a cell

input: a row, a column, a grid

return: the number of living neighbors of the cell

If anyone could implement this for me I would be very, very grateful.

I already have the following code and questions:

Here is most of my own code:

```
living_cell = "O"
dead_cell = "-"
def create_blank_grid():
line = [dead_cell for i in range(59)]
# grid = [["-"] * 30 for i in range(60)]
line.append("\n")
grid = [line for i in range(30)]
line = [dead_cell for i in range(59)]
line.append("\n")
grid = [line[:] for j in range(30)]
return grid
# print(create_blank_grid())
def print_grid(grid):
for i in grid:
# print(len(i))
for j in i:
if j == "\n":
print(" " * (69-59))
else:
print(j, end="")
# print_grid(create_blank_grid())
def load_design(file_name, grid):
myFile = open(file_name, "r")
coordinates = []
for line in myFile:
real_line = line.split()
row, col = real_line[0], real_line[1]
coordinates.append((row, col))
myFile.close()
# turn on certain cells here
for row, col in coordinates:
row, col = int(row), int(col)
# print(row, col)
grid[row][col] = living_cell
# print_grid(grid)
for i in grid:
# print(len(i))
for j in i:
print(j, end="")
# load_design("square.in", create_blank_grid()) # this file has this:
""" 11 34
11 35
12 34
12 35 """
```

I showed you this code because I have a question right now. Please bear this because I know I am probably violating some rules. If you can just attempt to answer it, I would appreciate it very much.

Function 1 in my plan: create_blank_grid

Function 2 in my plan: print_grid

Function 3 in my plan: load_design

Question: I have absolutely no idea on where to start with function 4, (by the way, functions 5 and 6 are helpers to function 4.) is there any starting point you could give me with this along with a little code to begin the 4th function? I guess really, what I am asking is help to start 5 and 6 since they are parts of function 4. Thanks!