Author: Sune Fischer
Date: 13:43:02 08/03/02
Go up one level in this thread
On August 03, 2002 at 14:21:37, Russell Reagan wrote: >I have YABQ. For the longest time I didn't understand what rotated bitboards >were used for, and now I understand their purpose. I'm still hung up on one >thing though, and hopefully someone can explain what I'm misunderstanding. > >As I understand it, you use your all pieces bitboard and the rotated bitboards >to compute the "state of the rank/file/diagonal", and you use that for various >things, such as computing mobility, generating legal moves, or whatever. > >Here is my problem. Let's say that you are computing mobility for a rook, and >you find that the state of the rank is 01001010, with the left bit being A1 and >the right bit being H1, and the rook being on in the middle, on E1. Now, if you >put this value into your mobility array, how does it know what the accurate >value of mobility is here? You could feed it the attack bits instead 01110110, this number indicates a rook on e1 (if it is the first rank) and pieces on b1 and g1 that blocks the "field of view" for the rook. It doesn't matter if they are friendly or not, they are still "attacked". When you generate moves for the rook, you just mask out the friendly pieces from the attacked squares, that leaves you with empty or squares of enemy pieces. If you want to generate captures, you just AND with the enemy piece occupied board. >There will be a difference in the mobility if the >piece on B1 is a black piece rather than a white piece. The "state of the rank" >makes no distinction between colors, so how can it accurately calculate mobility >or anything else accurately from the state of the rank/file/diagonal? > >Another example, if the state of the rank is 11111111 with a rook on E1, the >mobility could be either 0, 1, or 2, depending on the color of the pieces on D1 >and F1. > >What am I misunderstanding? If the state of the rank is 11111111 (I assume you are talking about all squares being occupied with pieces?) with the rook on E1, then the attack rank would be 00010100 regardless of the color of the pieces. >Russell -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.