rank method

int rank(
  1. int square
)

Returns that file that square is on.

Implementation

int rank(int square) => v - (square ~/ (h * 2)) - 1;