MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / step_cell

Function step_cell

example_code/item_071.py:156–160  ·  view source on GitHub ↗
(y, x, get_cell, set_cell)

Source from the content-addressed store, hash-verified

154
155print("Example 6")
156def step_cell(y, x, get_cell, set_cell):
157 state = get_cell(y, x)
158 neighbors = count_neighbors(y, x, get_cell)
159 next_state = game_logic(state, neighbors)
160 set_cell(y, x, next_state)
161
162
163alive = {(10, 5), (9, 5), (9, 6)}

Callers 2

item_071.pyFile · 0.70
simulateFunction · 0.70

Calls 2

count_neighborsFunction · 0.70
game_logicFunction · 0.70

Tested by

no test coverage detected