August 2018
Beginner
334 pages
10h 19m
English
We will add a new function to the BoardAI class as follows:
public static float ABNegascout (
Board board,
int player,
int maxDepth,
int currentDepth,
ref Move bestMove,
float alpha,
float beta)
{
// next steps here
}
if (board.IsGameOver() || currentDepth == maxDepth)
return board.Evaluate(player);
bestMove = null; float bestScore = Mathf.NegativeInfinity; float adaptiveBeta = beta;
foreach (Move m in board.GetMoves())
{
// next steps here
}
return bestScore;
Board b = board.MakeMove(m);
Read now
Unlock full access