Whether a and b are connected by a rook move.
a
b
bool orthogonallyConnected(int a, int b) => squaresOnSameFile(a, b) || squaresOnSameRank(a, b);