Author: Bruce Moreland
Date: 09:20:57 10/27/99
Go up one level in this thread
On October 27, 1999 at 07:59:12, Ulrich Tuerke wrote:
>
>>...
>>There are some other bugs:
>>
>>1) You have "if (score > beta)" and it should be "if (score >= beta)". This is
>>a serious bug. You have to very carefully check stuff like that.
>
>This is not necessarily a bug. This could just be another (admittedly
>non-standard ) convention, considering the boundary points still as parts of the
>interval. A consistent treatment in the whole program of this will also work
>correctly.
>However, I would also strongly suggest to adapt to the standard convention.
>Comparisons with literature or other source code will be much easier.
It won't work, will it?
Your search has the line:
score = -search(-beta, -alpha);
"search" is:
int search(int alpha, int beta)
In the search you try to get a score above alpha. If you don't, you do:
return alpha;
Since alpha used to be -beta, you returned -beta, which was negatized again, and
now you've got beta as your score. So when you do this line:
if (score >= beta)
return beta;
You will cut off. But if the line is:
if (score > beta)
return beta;
You won't return, because the score will be equal to beta.
bruce
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.