private static boolean isKingInCheckAfterMoveRec(byte[][] board, byte piece, int hPos, int vPos,
          int skiphPos, int skipvPos, int tohPos, int tovPos, int hAdd, int vAdd) {
    hPos += hAdd;
    vPos += vAdd;

    if (hPos < 0 || hPos > 7 || vPos < 0 || vPos > 7 || (hPos == tohPos && vPos == tovPos)) {
      return false;
    }

    if (board[hPos][vPos] == EMPTY || (skiphPos == hPos && skipvPos == vPos)) {
      return isKingInCheckAfterMoveRec(board, piece, hPos, vPos, skiphPos, skipvPos, tohPos,
              tovPos, hAdd, vAdd);
    }

    return board[hPos][vPos] == piece;
  }