Gets the square index at file and rank.
file
rank
int square(int file, int rank) => (v - rank - 1) * (h * 2) + file;