Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: questions about dynamically updating attackboards

Author: Sune Fischer

Date: 04:57:07 08/24/03

Go up one level in this thread


On August 24, 2003 at 07:35:28, Omid David Tabibi wrote:

>On August 24, 2003 at 07:19:55, Sune Fischer wrote:
>
>>On August 24, 2003 at 06:41:28, Omid David Tabibi wrote:
>>
>>>On August 23, 2003 at 20:53:40, Sune Fischer wrote:
>>>
>>>>On August 23, 2003 at 20:28:02, Omid David Tabibi wrote:
>>>>
>>>>>How do you find out how many pieces of a kind attack a square? E.g., how do you
>>>>>calculate the number of rooks that attack a square?
>>>>
>>>>If you just want the number this is not the fastest, you need to popcount.
>>>>However, I don't really see what good such a number would be.
>>>
>>>If you want to update your table dynamically, you need to know how many pieces
>>>of a kind attack a certain square.
>>
>>You don't need the number as such, what you need to know is exactly who does the
>>attacking, cause those are the ones that needs to be updated.
>>Howelse do you do *incremental* update?
>
>I know how many pieces of a kind attack each square. So, when for example I move
>a piece out of e4 and find out that e4 is attacked by one rook, I check to find
>out which rook was the attacker.

Yes and it is _this_ check that you save with the table, it's a lookup.

>>
>>> E.g., you move a piece out of e4, and you
>>>know that e4 is attacked by rook. Rook is a sliding piece and know that attack
>>>table should be updated. If you don't know by _how many_ rooks is e4 attacked,
>>>then you have to check all your rooks to check whether they attack e4. If you
>>>exactly know the number of attacking rooks however, you can stop as soon as you
>>>find the appropriate number.
>>
>>So lets say there are 2 rooks attacking e4, then what?
>>Where are these two rooks and how does this move change their attack status.
>
>What about 2 queens attacking e4?

Huh?
Same problem, every sliding attacker to that square needs to be updated (with a
few exceptions).

-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.