Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Attack Bitboards

Author: Sune Fischer

Date: 07:57:07 10/30/01

Go up one level in this thread


On October 30, 2001 at 10:32:44, Gerd Isenberg wrote:

>Sample C++ code:
>
>
>void CNode::MovePiece(unsigned int from, unsigned int to, unsigned int piece)
>{
>	// occupied bitboard updates
>	m_Inc.m_OccuBBA1H8 ^= sBits[from].sA1H8 ^ sBits[to].sA1H8;
>	m_Inc.m_OccuBBH1A8 ^= sBits[from].sH1A8 ^ sBits[to].sH1A8;
>	m_Inc.m_OccuBB90   ^= sBits[from].sBt90 ^ sBits[to].sBt90;
>	m_Inc.m_PieceBB[ALLPIECES] ^= sBits[from].sBBit ^ sBits[to].sBBit;
>	// piece bitboard updates
>	m_Inc.m_PieceBB[piece>>1] ^= sBits[from].sBBit ^ sBits[to].sBBit;
>	m_Inc.m_ColorPieceBB[ColorOfPiece(piece)] ^= sBits[from].sBBit ^
>sBits[to].sBBit;
>	// hash update
>	m_Inc.m_Pos.m_Hashval ^= sHashvtbl[piece][from] ^ sHashvtbl[piece][to];
>}
>
>...

Just out of curiosity;  You only use 2D arrays in your hash update?
Can you ignore the color or is that "object oriented" into it somewhere?
Else I would be worried, for instance in a rook endgame where the rooks can
"easily" transpose.


>__forceinline BitBoard FileAttacks(unsigned int sq) const
>{
>	return sFileAtta[sq][(*(((BYTE*)&(m_Inc.m_OccuBB90))+File(sq)) >> 1) & 0x3f];
>}

File(sq) ?

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