Пример #1
0
        public int[,] getBestState(StateNode currentNode)
        {
            alpha = -1000;
            beta  = 1000;
            int depth     = 0;
            int nodeValue = maxValue(currentNode, depth, alpha, beta);

            int[,] nodeState = CopyArray(root.getState());

            foreach (StateNode child in currentNode.Children)
            {
                if (child.getValue() == nodeValue)
                {
                    nodeState = CopyArray(child.getState());
                    break;
                }
            }

            return(nodeState);
        }