Skip to content

split alphabeta algorithm #4031

Answered by ghost
ghost asked this question in Q&A
May 22, 2022 · 4 comments · 1 reply
Discussion options

You must be logged in to vote

This is my alpha_beta function code , can you explain exactly how to split this function via lazy_SMP ?

int AlphaBeta(int alpha, int beta, int depth)
{

	if(depth==0) {
		return Evaluate(position);
	}

	Move moves[256];
	bestMove = 0;
	int bestScore = MinEval;
	for (int i = 0; i < moveCount; i++)
	{
		position.MakeMove(moves[i]);

		int score;
		int newDepth = depth - 1;

		score = -AlphaBeta(-beta, -alpha,newDepth);

		position.UnmakeMove();


		if (score > bestScore)
		{
			bestMove = moves[i];
			bestScore = score;
			if (score > alpha)
			{
				alpha = score;
				if (score >= beta)
				{
					return score;
				}
			}
		}
	}

	return bestScore;
}

please send exactly lazy_SMP algorithm…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Joachim26
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant