-inline Color square_color(Square s) {
- return Color((int(square_file(s)) + int(square_rank(s))) & 1);
+inline SquareColor square_color(Square s) {
+ return SquareColor((int(square_file(s)) + int(square_rank(s))) & 1);
+}
+
+inline bool same_color_squares(Square s1, Square s2) {
+ int s = int(s1) ^ int(s2);
+ return (((s >> 3) ^ s) & 1) == 0;