(Solved) : Patterns Many Cool Patterns Put Conway S Game Oflife Stable Change Generations Give Rise C Q35999524 . . .


Python programming please. No reverse or index functions. Noslicing.
Patterns There are many cool patterns than can be put into Conway’s Game ofLife. Some are stable, and will not change between generations, while some give rise to chaotic patterns that seem to last forever. Here are the patterns that you will have to be able to encode in your project, displayed in a 3×3 grid and anchored at (0,0) On the right is a basic 2×2 block. This is a stable state ij 0 1 2 – it does not change during the simulation! set pattern) will call this “block” cells [[1, 1, 0], This is a blinker. This is an oscillator-it will “blink” between two states! set pattern() will call this “blinker 0 1 cells [[e, 1, 0], This is a glider. It is a “spaceship” that moves along the grid diagonally, forever, unless it runs into other alive cells set pattern will call this “glider” 0 1 2 cells [[e, 1, ], i/j 0 1 2 This is a big block. After a handful of iterations, it turns into four blinkers. set_pattern) will call this “bigblock” cells- [[1, 1, 1], This is an R-pentomino. It may not seem like much, but ifi/j 0 you start your grid with just this pattern it will take almost 150 steps to reach a stable state! (1000+ in an infinite grid!) 0 set_pattern() will call this “R” 1 2 cells [[e, 1, 1], Complete the function definitions described in the next section. After you have completed writing and tested the functions with the provided tester, you can run the provided.py with the command python provided.py your_code_name.py 1c The 1c at the end is important! That’s the stage you’re on. This will pop open a window that looks like this In this window, you will see five different notable patterns in Conway’s Game of Life as described above This time, the grid is not clickable def set pattern (shape, row, column, cells): * Return value: True if the shape was successfully put into the cells, False otherwise o Modifies the cells parameter to place the shape in cells by starting with the top left corner of the shape at the row, column position in cells * Assumptions o shape is one of the strings described in the table of patterns at the beginning of the document o row and column are indexes of cells (might not be valid!) o Row and column might not be a valid index… if only you had written a function to ensure that o set_pattern(“block”,0,0,[[0,0,0, [0,0,0], [0,0,0]])I1,1,0], [1,1,0], [0,0,0]] e Notes: * Examples set-pattern(“R” ,0,0, [ [0,0,0], [0,0,0], [0,0,0]]) [[6,1,1], [1,1,0], [0,1,0] ] def count_neighbors (cells, row, col): * Return value: An integer; the number of “alive” neighbors that the cell in the given row and column has e Assumptions: o cells will be a two-dimensional list with at least one row and one element in that row » Notes: o The tests for this function are hidden. Be careful: row or column may not be valid (return -1 if so) Examples: o count_neighbors([0,0,0], [0,1,0], [0,0,0]],1,1) count-neighbors([[6,1,0,0],[6,1,0,1],[1,1,0,1]],2,1) 3 o count_neighbors ([[0,0,0],[0,1,0],[0,0,0]],-1,1)–1 Show transcribed image text
Expert Answer
Answer to Patterns Many Cool Patterns Put Conway S Game Oflife Stable Change Generations Give Rise C Q35999524 . . .
OR