private boolean isValidHorMove(int r1, int c1, int r2, int c2) {
        if (r1 != r2) {
            return false;
        }

        int step = c1 - c2 < 0 ? 1 : -1;
        if (step > 0) {
            for (int c = c1 + step; c < c2; c += step) {
                if (board[r1][c] != EMPTY) {
                    return false;
                }
            }
        } else if (step < 0) {
            for (int c = c1 + step; c > c2; c += step) {
                if (board[r1][c] != EMPTY) {
                    return false;
                }
            }
        }

        return true;
    }