MCPcopy Create free account
hub / github.com/ActiveState/code / eval_index

Function eval_index

recipes/Python/578062_Markov/recipe-578062.py:331–335  ·  view source on GitHub ↗
(grid, block_size, index)

Source from the content-addressed store, hash-verified

329# - should be of length word_size
330# - should be of length equal to number of dimensions in the grid
331def eval_index(grid, block_size, index):
332 offset = 0
333 for power, value in enumerate(reversed(index)):
334 offset += value * block_size ** power
335 return grid[int(offset)]
336
337################################################################################
338

Callers 3

check_cellFunction · 0.85
_encodeFunction · 0.85
_decodeFunction · 0.85

Calls 2

enumerateFunction · 0.50
reversedFunction · 0.50

Tested by

no test coverage detected