Question: python 3.6 def next_gen(grid): Given a Grid , create and return a new Grid that represents the next generation. Note that you will not be

python 3.6

def next_gen(grid):

Given a Grid , create and return a new Grid that represents the next generation. Note that you will not be modifying the original Grid valueeach cell's next state is dependent on its neighbors' previous state, so updating one cell at a time would incorrectly mix generation info

.o Assume: grid is a Grid

.o Hint: Use previous definitions!

oExamples based on the GridStrings shown in GridString definition.

o next_gen(gridA)gridBcopy

o next_gen(gridB)gridAcopy

o next_gen(gridC)gridCcopy

o Notes

. gridA and gridB are two parts of an "oscillator"; a stable cycle of grids. This one is called "blinker" , and was included in the Definitions section

.gridC is a "still life" example, a grid that equals its next generation. This one is called "boat".

In each case, we should be generating a new Grid valuehence the copy annotations

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!