Hello Manuel!
Manuel Peña wrote:Can you take a look to my LMR implementation.
Sems ok?
I think there is at least one important error.
alfabeta (int alfa,int beta,int depth,int ply,int tipe)
{
nmov=0;
...
mov(tree[i]);
nmov++;
if ((nmov>=5)&&(ply>=3)&&(!(tipe&CHECK)))
You should probably add some more conditions here. In particular, reducing captures is probably too dangerous. Most of us also don't reduce passed pawn pushes.
{
ev=-alfabeta(-alfa-1,-alfa,depth-2,ply+1,tipe);
if ((ev>-beta)&&(ev<-alfa)) ev=-alfabeta( -beta,-alfa,depth-1,ply+1,tipe);
}
else ev=-alfabeta(-beta,-alfa,depth-1,ply+1,tipe);
unmov();
...
}
The line with "if ((ev>-beta)&&(ev<-alfa))..." looks very strange. Comparing ev to -beta and -alfa makes no sense. I am not sure how you were thinking, but I guess you must have added an extra negation somewhere in your code.
Using "if ((ev > alfa) && (ev < beta))..." makes more sense, but is still wrong. You shouldn't allow beta cutoffs based on a reduced-depth search. I think just "if (ev > alfa)" is the correct condition to use.
Tord