Henk wrote:I don't understand why one should use bitboards for generating all moves. The engine can only apply one move at the time, so I need a separate bitboard for each move.
For captures it's a different story. For you only have one capture per direction.
Bitboards are especially effective when generating slider moves, multiply, mask and shift and a couple of lookups (magic bbs) are certainly much faster than iterating over n squares.
Why do you keep talking about movegen, what about eval and mobility?
And why would you want a "separate bitboard" for each move?
Seems to me you're on a trolling spree again, trying to confuse OP
Henk wrote:I don't understand why one should use bitboards for generating all moves. The engine can only apply one move at the time, so I need a separate bitboard for each move.
For captures it's a different story. For you only have one capture per direction.
Bitboards are especially effective when generating slider moves, multiply, mask and shift and a couple of lookups (magic bbs) are certainly much faster than iterating over n squares.
Why do you keep talking about movegen, what about eval and mobility?
And why would you want a "separate bitboard" for each move?
Seems to me you're on a trolling spree again, trying to confuse OP
If I apply a move I apply one move only so if I represent that with a bitboard I need a bitboard with one move only.
Last edited by Henk on Thu Jul 03, 2014 3:06 pm, edited 1 time in total.
Henk wrote:If I apply a move I apply one move only so if I represent that with a bitboard I need a bitboard with one move only.
I don't get it. You need to update existing bitboard(s) representation when making a move (usually boils down to a simple xor).
If I have a bitboard which contains all moves I need to count these bits to compute mobility. I don't know or understand how counting bits can be implemented fast.
SSE4.2 has popcnt instruction. Other than that you can either use lookup tables/simple loop (masking out LSBit) or clever SWAR,
chessprogramming wiki has (surprisingly an excellent article about it: https://chessprogramming.wikispaces.com ... tion+Count
... but bitboards are not there for representing moves. You don't need 64 bits for that. Bitboards capture the occupation of squares of a certain piece type or the attack pattern of a certain piece on a certain square.
You can of course use a pair of bitboards to represent a move (a "before" and "after" bitboard and then figure out what move it represents by looking at the difference). But his is probably the most inappropriate usage of bitboards one can think of.