countNeighbors method

int countNeighbors(
  1. int x,
  2. int y
)

The number of cardinal neighbors of the tile at column x row y

Implementation

int countNeighbors(int x, int y) => neighbors(x, y).length;