(!try changing dead to or another character dead the character representing dead cell (!try changing alive to '|and dead to '- the cells and nextcells are dictionaries for the state of the game their keys are (xytuples and their values are one of the alive or dead values nextcells { put random dead and alive cells into nextcells for in range(width)loop over every possible column for in range(height)loop over every possible row / chance for starting cells being alive or dead if random randint( = nextcells[(xy)alive add living cell else nextcells[(xy)dead add dead cell while truemain program loop each iteration of this loop is step of the simulation print('\ separate each step with newlines cells copy deepcopy(nextcells print cells on the screen for in range(height) for in range(width) print(cells[(xy)]end=''print the or space print(print newline at the end of the row print('press ctrl- to quit ' calculate the next step' cells based on current step' cells for in range(width) for in range(height) get the neighboring coordinates of (xy)even if they wrap around the edge left ( width right ( width above ( height below ( height count the number of living neighbors numneighbors if cells[(leftabove)=alive numneighbors + top-left neighbor is alive if cells[(xabove)=alive numneighbors + top neighbor is alive if cells[(rightabove)=alive numneighbors + top-right neighbor is alive if cells[(lefty)=alive numneighbors + left neighbor is alive if cells[(righty)=alive numneighbors + right neighbor is alive if cells[(leftbelow)=aliveconway' game of life