Author: Maurizio Di Vitto
Date: 08:04:21 12/09/03
Dear Mr Wegner, Thanks again for your time. I would like to show (following your instruction) how I initialized the two bitboards and I have a question: Rank_attack[64][256] I memorize the state in a bitboard(keep_value) and shift this value to the rank of the square( keep_value=state<<8*Rank(square) ): State=3 Square=27(fourth rank=3) keep_value=state<<8*Rank(square) keep_value: 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 then I create a bitboard m with the square: m|=mask[square] little question: m=mask[square] is the same? So I have: m: 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 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 rank=row[square]=3 right=1; left=1; while m&keep_value==0 and m==1 and row[square-right]=rank m>>1 rank_attack[square][state]|=m; right++ (the same for left) file_attack[64][256]: I memorize the state in keep_value, but I will shift to put this value on the rank of the rotated square: State=3 Square=17 Non-rotated square(normal square) 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 keep_value: 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 0 0 0 1 1 0 0 0 0 0 0 0 0 then m will have the rotated square: 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 0 0 0 0 0 0 0 0 0 0 0 0 0 rank=row[rotated square]=1 right=1 left=1 up=8 down=8 while m&keep_value==0 and m==1 and row[rotated square-right]==rank m>>1 file_attack[square][state]|=mask[square+up] right++; up+=8; …………….. Is it a right way? The biggest question is: if the state is 3 and the square is 1, you’ll have: state 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 0 0 0 0 0 0 0 0 0 0 0 1 1 square 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 0 0 0 0 0 0 0 0 0 0 0 1 0 so I deduce that you’ll never calculate all the 256 for each square. Is it right. Thank you again for your time. Maurizio Di Vitto
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.