ixfx
    Preparing search index...
    • Returns a generator that iterates over cells with a given logic. Once created, the same logic can be used on different grids - it is a pure function.

      const v = create(`random`); // Randomly visit cells
      for (const cell of v(grid)) {
      // do something with cell
      }

      Logic types: 'row': left-to-right, top-to-bottom 'column': top-to-bottom, left-to-right 'neighbours': neighbours surrounding cell (eight) 'breadth': breadth-first 'depth': depth-first 'random': any random cell in grid 'random-contiguous': any random cell neighbouring an already visited cell

      Under the hood it uses createWithLogic, but lets you specify the logic with a simple string.

      Parameters

      Returns (
          grid: Grid,
          optionsOverride?: Partial<
              Readonly<
                  {
                      boundsWrap: GridBoundsLogic;
                      debug: boolean;
                      reversed: boolean;
                      start: GridCell;
                      visited: ISetMutable<GridCell>;
                  },
              >,
          >,
      ) => Generator<GridCell>