square method

int square(
  1. int file,
  2. int rank
)

Gets the square index at file and rank.

Implementation

int square(int file, int rank) => (v - rank - 1) * (h * 2) + file;