Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Null move

Author: James Robertson

Date: 21:37:16 02/03/99

Go up one level in this thread


On February 04, 1999 at 00:15:59, Robert Hyatt wrote:

>On February 03, 1999 at 22:54:36, James Robertson wrote:
>
>>Help!!
>>I am trying to implement null move into my program. Unfortunately, I have spent
>>a ton of time and gotton nowhere. I thought I had it when my program won it's
>>first ever game against EXchess, but realized it was a fluke when it hung first
>>a bishop and then a queen against Faile. Then I found a huge bug, and after
>>fixing, the null move doesn't seem to be speeding up the search at all. Anyway,
>>here is my AB code: what am I doing wrong?
>>
>>int AB (int wtm, int alpha, int beta, int depth, int ply, int do_null) {
>>
>>  if (do_null && NotInCheck()) {
>>    if (depth > 3) score = -AB(wtm^1, -beta, -beta+1, depth-3, ply+1, false);
>>    else score = -Quiesce(wtm^1, -beta, -alpha, ply+1);
>>    if (score >= beta) return beta;
>>  }
>>
>>  GenMoves();
>>  while (moves){
>>    MakeMove();
>>    score = -AB(wtm^1, -beta,-alpha,depth-1,ply+1,true);
>>    UnMakeMove();
>>    if (score > alpha) SavePV();
>>    if (score >= beta) return beta;
>>  }
>>}
>>
>>Thanks for any help!
>>
>>James
>
>
>I'd suggest looking at crafty source, module=search.c, near the top.  Which
>shows this...
>
>A couple of things I see however...
>
>1.  you have to be very careful with things like en passant status.  Since
>a null-move _must_ clear this before going to the next ply...

Ok.

>
>2.  don't do this if there are no pieces (only pawns) left for the side on
>move, otherwise zugzwang will cause problems.  Do it _carefully_ if there is
>only one piece for the side on move.

Ok, sounds cool.

>
>3.  don't forget to handle the EP status in your hash key if you keep it there
>(as I do).

I don't have hash tables yet, but when I get them I'll watch out for this. I
tried out Mr. Moreland's suggestions, and things look better. Thanks for your
help too!!

James



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.