Runs the provided visitor for steps, returning the cell we end at

// Create visitor & stepper
const visitor = Grids.Visit.create(`row`);
const stepper = Grids.Visit.stepper(grid, visitor);

// Step by 10
stepper(10); // GridCell {x,y}

// Step by another 2
stepper(2);
  • Parameters

    Returns ((step: number, fromStart?: boolean) => undefined | GridCell)

      • (step, fromStart?): undefined | GridCell
      • Parameters

        • step: number
        • fromStart: boolean = false

        Returns undefined | GridCell