| 265 | # - should be a block from a sudoku_key |
| 266 | # - should have same unique bytes as the expanding grid |
| 267 | def expand_array(grid, block): |
| 268 | cache = [] |
| 269 | grid_size = len(grid) |
| 270 | block_size = len(block) |
| 271 | for byte in block: |
| 272 | index = grid.index(bytes([byte])) |
| 273 | for part in range(0, grid_size, block_size): |
| 274 | cache.append(grid[part+index:part+block_size]) |
| 275 | cache.append(grid[part:part+index]) |
| 276 | return b''.join(cache) |
| 277 | |
| 278 | ################################################################################ |
| 279 | |