Computer Chess Club Archives


Search

Terms

Messages

Subject: Bug in craftys movegenerator?

Author: Mikael Bäckman

Date: 03:56:10 07/10/03


Hi,

I've been tracking down problems with my engine, and found some oddities in
updatíng the hashsignature after each move. Anyways, I thought "I wonder how
crafty does it" and well, I think crafty does it wrong.

Code from Crafty 19.3:

  case king:
    if (wtm) {
      [snip]
->    if (WhiteCastle(ply) > 0) {     <-
        if (WhiteCastle(ply+1)&2) HashCastleW(1,HashKey);
        if (WhiteCastle(ply+1)&1) HashCastleW(0,HashKey);
        [snip]
      }
    }
    else {
      [snip]
->    if (BlackCastle(ply+1) > 0) {   <- not the same ply as above?
        if (BlackCastle(ply+1)&2) HashCastleB(1,HashKey);
        if (BlackCastle(ply+1)&1) HashCastleB(0,HashKey);
        [snip]
      }
    }
    break;

Since crafty knows how to castle the code obviously works, but it doesn't look
right..

Regards,
Mikael



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.