Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bug in craftys movegenerator?

Author: Michel Langeveld

Date: 05:26:08 07/10/03

Go up one level in this thread


On July 10, 2003 at 06:56:10, Mikael Bäckman wrote:

>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

Since blackcastling rights only change by black moves ...
I think can be that it goes right in both ways. I agree that it would be neat to
use one approach



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.