示例#1
0
        private void ComputerMove()
        {
            Board nextBoard = Minimax.FindNextBoard(_board);

            AnimateTransition(_board, nextBoard);
            _board = nextBoard;
            pictureBoxBoard.Refresh();

            _currentPlayer = PlayerType.Human;

            CheckFinish();
        }
示例#2
0
        private void ComputerMove()
        {
            AlphaBetaBoard alphaBetaBoard = new AlphaBetaBoard();

            alphaBetaBoard.board = _board;
            alphaBetaBoard.eval  = _board.EvaluationFunction();

            Board nextBoard = Minimax.AlphaBetaPruning(alphaBetaBoard, Double.NegativeInfinity, Double.PositiveInfinity, 5, PlayerType.Computer).board;

            AnimateTransition(_board, nextBoard);

            _board = nextBoard;
            pictureBoxBoard.Refresh();

            _currentPlayer = PlayerType.Human;

            CheckFinish();
        }