Exemple #1
0
        private void PCMove()
        {
            //Thread.Sleep(5000);
            Point AIMove = new Point();
            AI    PC     = new AI();

            PC.AIStart();
            if (GlobalVariable.fWin)
            {
                PC.Move((int)GlobalVariable.WinMove[0].Y, (int)GlobalVariable.WinMove[0].X);
                AIMove = GlobalVariable.WinMove[0];
            }
            else
            {
                PC.EvalBoard(2);
                AIMove = PC.MaxPos();
                PC.Move((int)AIMove.Y, (int)AIMove.X);
            }
            //tính toán nước đi ở phía trên
            update(AIMove);
        }
Exemple #2
0
        private void PCAutoPlay()
        {
            if (YourBotTurn == false)
            {
                PushMessage("This is not your turn", "Server");
                return;
            }
            Point AIAutoMove = new Point();
            AI    PC         = new AI();

            PC.AIStart();
            if (GlobalVariable.fWin)
            {
                PC.Move((int)GlobalVariable.WinMove[0].Y, (int)GlobalVariable.WinMove[0].X);
                AIAutoMove = GlobalVariable.WinMove[0];
            }
            else
            {
                PC.EvalBoard(2);
                AIAutoMove = PC.MaxPos();
                PC.Move((int)AIAutoMove.Y, (int)AIAutoMove.X);
            }
            autoupdate(AIAutoMove); // update UI;
        }
Exemple #3
0
 private void PCAutoPlay()
 {
     if (YourBotTurn == false)
     {
         PushMessage("This is not your turn","Server");
         return;    
     }
     Point AIAutoMove = new Point();
     AI PC = new AI();
     PC.AIStart();
     if (GlobalVariable.fWin)
     {
         PC.Move((int)GlobalVariable.WinMove[0].Y, (int)GlobalVariable.WinMove[0].X);
         AIAutoMove = GlobalVariable.WinMove[0];
     }
     else
     {
         PC.EvalBoard(2);
         AIAutoMove = PC.MaxPos();
         PC.Move((int)AIAutoMove.Y, (int)AIAutoMove.X);
     }
     autoupdate(AIAutoMove); // update UI;
 }
Exemple #4
0
 private void PCMove()
 {
     //Thread.Sleep(5000);
     Point AIMove = new Point();
     AI PC = new AI();
     PC.AIStart();
     if (GlobalVariable.fWin)
     {
         PC.Move((int)GlobalVariable.WinMove[0].Y, (int)GlobalVariable.WinMove[0].X);
         AIMove = GlobalVariable.WinMove[0];
     }
     else
     {
         PC.EvalBoard(2);
         AIMove = PC.MaxPos();
         PC.Move((int)AIMove.Y, (int)AIMove.X);
     }
     //tính toán nước đi ở phía trên
     update(AIMove);
 }