Ejemplo n.º 1
0
        protected override LineBetweenCircles TurnAction()
        {
            LineBetweenCircles closingEdge;

            if ((closingEdge = AICommon.FindBoxClosingEdge(existingMoves, nonExistingMoves, Player.RED)) != null)
            {
                return(closingEdge);
            }
            else
            {
                int randomIndex = (int)(random.NextDouble() * nonExistingMoves.Count);
                return(nonExistingMoves[randomIndex]);
            }
        }
Ejemplo n.º 2
0
        protected override LineBetweenCircles TurnAction()
        {
            LineBetweenCircles closingEdge;

            if ((closingEdge = AICommon.FindBoxClosingEdge(existingMoves, nonExistingMoves, Player.RED)) != null)
            {
                return(closingEdge);
            }
            else
            {
                minimax = new IntermediateMinimax(existingMoves, nonExistingMoves, boxes, whoAmI, minimaxDepth);

                return(minimax.GetBestMove());
            }
        }