Author: Andrew Williams
Date: 15:19:11 08/23/03
Go up one level in this thread
On August 23, 2003 at 17:43:55, Sune Fischer wrote:
>On August 23, 2003 at 17:32:06, Andrew Williams wrote:
>
>>On August 23, 2003 at 17:19:20, Sune Fischer wrote:
>>
>>>On August 23, 2003 at 16:24:28, Andrew Williams wrote:
>>>
>>>I know this scheme very well, perhaps we should compare nps ;)
>>>
>>
>>PM does about 170knps.
>>
>>>Do you also xor out the changes?
>>>
>>>One problem I see with this, is that 32 bits is too big to make use of SEE by
>>>table lookups.
>>>
>>
>>Yes. It's nowhere near as nice Ed's scheme.
>>
>>>Another problem is the number of squares that needs updating in the endgame with
>>>sliding pieces, it's just enourmous.
>>>
>>
>>Yes.
>>
>>>>2. Go over all 64 squares, masking out the attacks identified in (1) above.
>>>
>>>You don't need all 64 squares, just the changes.
>>>
>>
>>Yes. This is one of those things I keep "in hand" for when I run out of new
>>things to try.
>
>I think you should have a factor 2 in move making here, no need to run over all
>64 bit squares.
>
>You compile a list of squares that need updating, to,from etc. and then go
>through the pieces attack them.
>It's quite compact in fact:
>
>inline void BOARD::GenAttackers(uint32 affected,uint co) {
> register uint ix;
> register BITBOARD xors;
>
> while (affected) {
> ix = FirstBit32(affected);
> xors = attack_ix[ix]; // old attack board
> attack_ix[ix] = GenAttack(ty_ix[ix],sq_ix[ix],co); // new attack board
> xors ^= attack_ix[ix]; // the changes
> while (xors)
> attack_sq[GetFirstBitAndClear64(xors)] ^= 1<<ix;
> affected &= affected-1;
> }
> }
>}
>
>
Are we talking about the same thing here? affected is the pieces that are
affected (I assume so because it's a 32-bit quantity). So:
ix = FirstBit32(affected); // Get the index of one of the affected pieces
xors = attack_ix[ix]; // old attack board
What is attack_ix[] ? My program has an array called attacks[], which contains
64 32-bit uints. How does attack_ix[] relate to that?
Andrew
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.