Beispiel #1
0
 public int findMax(intNode root, int alpha, int beta, bool max)
 {
     int bestMove = root.value;
     List<int> minList = new List<int>();
     List<int> maxList = new List<int>();
     if (root.children == null)
         bestMove = root.value;
     else if (alpha < beta)
     {
         if (!max)
         {
             foreach (intNode child in root.children)
             {
                 if (findMax(child, alpha, beta, true) < beta)
                     bestMove = child.value;
                 else
                     break;
             }
         }
         else
         {
             foreach (intNode child in root.children)
             {
                 if (findMax(child, alpha, beta, false) > alpha)
                     bestMove = child.value;
                 else
                     break;
             }
         }
     }
     return bestMove;
 }
Beispiel #2
0
        public void DeleteFirst()
        {
            intNode temp = head;

            head = head.Next;
            temp = null;
        }
Beispiel #3
0
 int evaluate(intNode number)
 {
     return number.value;
 }