squaresOnSameFile method

bool squaresOnSameFile(
  1. int a,
  2. int b
)

Returns true if a and b are facing. Useful for Xiangqi's flying generals rule.

Implementation

bool squaresOnSameFile(int a, int b) => file(a) == file(b);