Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: questions about dynamically updating attackboards

Author: Sune Fischer

Date: 15:49:39 08/23/03

Go up one level in this thread


On August 23, 2003 at 18:19:11, Andrew Williams wrote:

Hmm, maybe I wasn't clear, it's been a while since I looked at this stuff :)

As an example:

A rook moves from square "f" to square "t", and captures a knight on "t".
Vi find the rook's index and the knight's index and add them to the list:
affected = 1<<(ix_sq[f]) | 1<<(ix_sq[t]);
All sliders attacking f and t also needs updating (with some exceptions you can
figure):
affected |= sliders&(attack_sq[f]|attack_sq[t])

of course sliders here are (ix_pc[BISHOP]|ix_pc[ROOK]|ix_pc[QUEEN])

So now you know what pieces needs their attack boards updated, and you take one
piece of a time finding the bits that have changed and mask them out.

Maybe it is better to use another squares table instead of indexes, I never
could decide on that.

-S.



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.