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

Function step_cell

example_code/item_072.py:134–138  ·  view source on GitHub ↗
(y, x, get_cell, set_cell)

Source from the content-addressed store, hash-verified

132 return state
133
134def step_cell(y, x, get_cell, set_cell):
135 state = get_cell(y, x)
136 neighbors = count_neighbors(y, x, get_cell)
137 next_state = game_logic(state, neighbors)
138 set_cell(y, x, next_state)
139
140def simulate_threaded(grid):
141 next_grid = LockingGrid(grid.height, grid.width)

Callers

nothing calls this directly

Calls 2

count_neighborsFunction · 0.70
game_logicFunction · 0.70

Tested by

no test coverage detected