SideScrollingSnakeComponent.isPositionValid uses x < cols + 1 and y < rows + 1 (with x > 0 / y > 0), so coordinates (cols, y) and (x, rows) are treated as walkable even though grid only has indices [0..cols-1] / [0..rows-1].
Impact
aStarPath → getValidDirections can enqueue those cells; the next iteration does this.grid[newPos.y][newPos.x].commitType and throws when the snake explores the right/bottom edge.
Repro (unit)
With cols=7, isPositionValid(7, 2) returns true but grid[2][7] is undefined.
Expected
Bounds should be x >= 0 && x < cols && y >= 0 && y < rows (or whatever playable rectangle is intended — today column/row 0 are also excluded).
## Summary
`SideScrollingSnakeComponent.isPositionValid` uses `x < cols + 1` and `y < rows + 1` (with `x > 0` / `y > 0`), so coordinates `(cols, y)` and `(x, rows)` are treated as walkable even though `grid` only has indices `[0..cols-1]` / `[0..rows-1]`.
## Impact
`aStarPath` → `getValidDirections` can enqueue those cells; the next iteration does `this.grid[newPos.y][newPos.x].commitType` and throws when the snake explores the right/bottom edge.
## Repro (unit)
With `cols=7`, `isPositionValid(7, 2)` returns `true` but `grid[2][7]` is `undefined`.
## Expected
Bounds should be `x >= 0 && x < cols && y >= 0 && y < rows` (or whatever playable rectangle is intended — today column/row 0 are also excluded).
## Found by
Wave 6 coverage tick 11 / agent a1 (`side-scrolling-snake.component.spec.ts`).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
SideScrollingSnakeComponent.isPositionValidusesx < cols + 1andy < rows + 1(withx > 0/y > 0), so coordinates(cols, y)and(x, rows)are treated as walkable even thoughgridonly has indices[0..cols-1]/[0..rows-1].Impact
aStarPath→getValidDirectionscan enqueue those cells; the next iteration doesthis.grid[newPos.y][newPos.x].commitTypeand throws when the snake explores the right/bottom edge.Repro (unit)
With
cols=7,isPositionValid(7, 2)returnstruebutgrid[2][7]isundefined.Expected
Bounds should be
x >= 0 && x < cols && y >= 0 && y < rows(or whatever playable rectangle is intended — today column/row 0 are also excluded).Found by
Wave 6 coverage tick 11 / agent a1 (
side-scrolling-snake.component.spec.ts).Already present on
spikersoft-angularmaster.isPositionValidusesx < cols && y < rows, so A* cannot enqueuegrid[y][cols]/grid[rows][x]. Closing.