Пример #1
0
        public bool ProbeScore(ZobristHash hash, int alpha, int beta, int depth, ref int score)
        {
            int i = CalculateHashIndex(hash);

              if (m_hashTable[i].Flag != AlphaBetaFlag.NoScore && hash.Equals(m_hashTable[i].Hash))
              {
            if (m_hashTable[i].Depth >= depth)
            {
              if (m_hashTable[i].Flag == AlphaBetaFlag.ExactScore)
              {
            score = m_hashTable[i].Score;
            return true;
              }

              if (m_hashTable[i].Flag == AlphaBetaFlag.AlphaScore && m_hashTable[i].Score <= alpha)
              {
            score = alpha;
            return true;
              }

              if (m_hashTable[i].Flag == AlphaBetaFlag.BetaScore && m_hashTable[i].Score >= beta)
              {
            score = beta;
            return true;
              }
            }
              }

              return false;
        }
Пример #2
0
        public MoveIdentifier ProbePvMove(ZobristHash hash)
        {
            int i = CalculateHashIndex(hash);

              if (m_hashTable[i].Flag != AlphaBetaFlag.NoScore && hash.Equals(m_hashTable[i].Hash))
            return m_hashTable[i].PvMove;
              else
            return new MoveIdentifier(Square.None, Square.None, Piece.None);
        }