Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A question in TSCP source code please?

Author: Uri Blass

Date: 17:10:42 10/19/03

Go up one level in this thread


On October 19, 2003 at 19:49:37, Gopi wrote:

>I know that but in castle&1 what is that castle value so that that condition
>becomes true so that gen_push(E1,G1,2) is done.And similarly for castle&2 what
>comes castle value here? Thanks


castle=15 if all castles are allowed.
This is its value in the beginning of the game.

in binary representation castle=1111 in the beginning of the game.

When you do moves castle may be changed to have less 1's.

If you move the white king the last 2 1's become 0 by
castle=castle&12

If you move the white rook at h1 or capture it
one of the last 1's become 0 by
castle=castle&14

For doing all this you have the line
castle&=castle_mask[m.from]&castle_mask[m.to];

Uri



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.