Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hashing rules

Author: Robert Hyatt

Date: 19:46:58 04/05/03

Go up one level in this thread


On April 05, 2003 at 14:02:09, Russell Reagan wrote:

>Regarding hashing of the en passant square and castling rights, I have a few
>questions. I think I understand this now. I'd just like some verification.
>
>You should only hash the en passant square if it is possible for an enemy pawn
>to execute the en passant capture. This means, ideally, that if there is a pawn
>present to make the capture, but it is pinned and cannot legally make the
>capture, that you should not hash the en passant square. Is this correct?

Correct, but it might be too expensive to determine if the pawn is
pinned.  It is good enough to simply note that a pawn _can_ be captured
EP only if it has advanced two squares and there is an enemy pawn on an
adjacent file in the right place.



>
>Regarding when to include castling rights in the hash signature, consider the
>following position, with and without castling rights set.
>
>[D]4k3/8/8/8/2b5/8/2PP4/4K2R w
>
>Notice that the white king cannot castle since the black bishop attacks f1. If
>this position arose 3 times, but with differing castling rights, then that is
>NOT a draw by repetition. Correct? The rule that I'm reading is from the FIDE
>Laws of Chess:
>
>"Positions are not the same...if the right to castle has been changed
>temporarily or permanently."
>
>In short, the rules are...
>
>1. Always hash the board data.
>
>2. Always hash the side to move.
>
>3. Always hash the castling rights.
>
>4. Only hash the en passant square if an enemy pawn can legally execute the en
>passant capture on the next move.
>
>5. Never hash the fifty move counter.
>
>Let me know if I'm misunderstanding anything. Thanks.


Sounds ok...  except for the suggestion I made.



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.