Author: Zach Wegner
Date: 08:10:38 12/15/03
Go up one level in this thread
On December 15, 2003 at 10:50:14, Maurizio Di Vitto wrote: >Dear Mr Wegner, >I have another doubt. I red somewhere that to know the state you have to >calculate it by using an OR operation between 255 and the 8 bits interested, but >if you have this situation (like all situation): > >0 0 0 0 0 0 0 0 >0 0 0 0 0 0 0 0 >0 0 0 0 0 0 0 0 >0 0 0 0 0 0 0 0 >0 0 0 0 0 0 0 0 >0 0 0 0 0 0 0 0 >1 0 1 1 0 1 0 1 >0 0 0 0 0 0 0 0 > >a b c d e f g h > >the rook is in f2, so if we want to know the state we have to shift all the >bitboards of 8 units and Oring it by 255. But if we thinking about >rank_attack[10(square)][181] we won’t find anything because the state 181 has >the square number 10 not empty, so for that square is impossible thinking that >in the same square there is another piece. So we should transform that rank in >10110001, without the rook, in this way you can have the rank situation with >rank_attack[10][177].Is it right? Not quite. The thing to remember is that your initialization code knows about what square is set, and knows that the bit will be set. The code that you posted earlier should work, regardless if the bit with rook on it is set, so rank_attack[10][181] and rank_attack[10][177] should both give: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 >Thanks again for your help. >Maurizio Di Vitto Regards, Zach
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.