[computer-go] AlphaBeta
Phil G
go at thinkedge.com
Sun Sep 24 15:20:20 PDT 2006
I have a question that I could use some help on. In an typical AlphaBeta search (sample code below), how do you actually return the best move found by the search? I see how the best move's evaulation is returned, but not the move itself.
int AlphaBeta(int depth, int alpha, int beta)
{
if (depth == 0)
return Evaluate();
GenerateLegalMoves();
while (MovesLeft()) {
MakeNextMove();
val = -AlphaBeta(depth - 1, -beta, -alpha);
UnmakeMove();
if (val >= beta)
return beta;
if (val > alpha)
alpha = val;
}
return alpha;
}
Thanks in advance,
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://computer-go.org/pipermail/computer-go/attachments/20060924/525537b2/attachment.htm
More information about the computer-go
mailing list