Enumerate all cell coordinates in an efficient manner.
Runs left-to-right, top-to-bottom.
If end of grid is reached, behaviour depends on wrap:
true (default): iterator will wrap to ensure all are visited.
false: iterator stops at end of grid
import { Grids } from'ixfx/geometry.js';
// Enumerate each cell position, left-to-right, top-to-bottom for (constcellofGrids.By.cells(grid)) { // cell will be { x, y } }
See also:
cellValues: Iterate over cell values
cellsAndValues: Iterate over pairs of cell coordinates and cell values
Enumerate all cell coordinates in an efficient manner. Runs left-to-right, top-to-bottom.
If end of grid is reached, behaviour depends on
wrap: true (default): iterator will wrap to ensure all are visited. false: iterator stops at end of gridSee also: cellValues: Iterate over cell values cellsAndValues: Iterate over pairs of cell coordinates and cell values