示例#1
0
 public Node(TicTacToe ttt, int move, int height)
 {
     this.ttt    = ttt;
     this.move   = move;
     this.height = height;
     ttt.Setze(move / ttt.Size, move % ttt.Size);
     if (ttt.GameEnd)
     {
         if (ttt.Winner != ' ')
         {
             if (ttt.Winner == ttt.player1)
             {
                 losses++;
             }
             else
             {
                 wins++;
             }
         }
         else
         {
             ties++;
         }
         ProcessVals();
     }
     else
     {
         ProccessNextMoves();
     }
 }
示例#2
0
        public void NextMove()
        {
            curr = curr.nodes[game.lastMove];
            Node next = null;

            foreach (Node n in curr.nodes.Values)
            {
                if (next == null)
                {
                    next = n;
                }
                else if (next.val < n.val)
                {
                    next = n;
                }
            }
            curr = next;
            game.Setze(curr.move / game.Size, curr.move % game.Size);
        }