Author: Klaus Friedel
Date: 14:48:42 05/12/04
Go up one level in this thread
On May 12, 2004 at 14:05:30, Pallav Nawani wrote:
>Hello,
>
>I am trying to implement NULL move heuristic in my chess program, Natwarlal.
>Addition of null move reduces the number of nodes drastically, but it leads to
>the program making stupid captures. For instance, capturing a pawn by a bishop
>when the pawn is well defended. What should I do to avoid this problem?
>
>The code I use follows:
>(gi is the structure used to hold moves, undo stack, etc.)
>
> // Lets try a NULL move
> if(!avoidnull
> && !gi.uptr->incheck
> && gi.ply > 1) {
>
> make_null_move(gi);
> if(depth - NULLRED > 0)
> score = -search(gi, -beta, -alpha, depth - NULLRED);
> else
> score = -qsearch(gi, -beta, -alpha);
> undo_null_move(gi);
> if(score >= beta) {
> return beta;
> }
> }
>
>Thanks in advance.
>Pallav Nawani
This snipped looks ok to me. Maybe the oddness is hidden in make_null_move()
or undo_null_move().
Did you clear the en passant target in make_null_move() ?
Does your hashcode after make_null_move() really fit the resulting position ?
Regards,
Klaus Friedel
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.