Author: José Carlos
Date: 00:14:46 11/22/01
Go up one level in this thread
On November 21, 2001 at 18:23:08, Michel Langeveld wrote:
>I build nullmove in my chessprogram and received a problem.
>
>The example which is on Bruce side seems not to work in certain positions.
>Especially positions where it's possible to give mate:
>
>[D] rnbq1bnr/pp2k3/2p1p1B1/3pP1p1/7p/4PQ2/PPPN1PPP/R3K1NR b KQ
>
>After Qc7 white doesn't see Qf7 anymore.
>
>It seems to be that the line:
>
>val = -AlphaBeta(depth - 1 - R, -beta, -beta + 1);
>
>Must be changed into:
>
>val = -AlphaBeta(depth - 1 - R, -beta+1, -beta);
>
>
>--------- BELOW HERE THE EXAMPLE OF BRUCE ---------------
>
>#define R 2
>
>
>
>int AlphaBeta(int depth, int alpha, int beta)
>{
> if (depth == 0)
> return Evaluate();
> MakeNullMove();
> val = -AlphaBeta(depth - 1 - R, -beta, -beta + 1);
> UnmakeNullMove();
> if (val >= beta)
> return beta;
> GenerateLegalMoves();
> while (MovesLeft()) {
> MakeNextMove();
> val = -AlphaBeta(depth - 1, -beta, -alpha);
> UnmakeMove();
> if (val >= beta) // Delete these to get straight
> return beta; // min-max instead of alpha-beta.
> if (val > alpha)
> alpha = val;
> }
> return alpha;
Tested with my program (R=3/2) it sees the mate in ply 3.
I don't do null move in the PV. I don't know if this can make a difference in
this position.
José C.
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.