user1103205
user1103205

Reputation: 185

chess sliding pieces bitboards

I understood non-sliding pieces quite easily but I've been having some trouble with the sliding pieces.

I currently have 64 bitboards (1 for each square, not saved in a array as well as 8 bitboards for masked rows, 8 bitboards for cleared rows, 8 bitboards for masked columns, and 8 bitboards for cleared columns, as well as, of course, a bitboard for each type of piece.

In generating legal moves for the bishop and rook I hear you are suppose to get the first occupied square on the column/row.

My questions are:

Currently I have it going with no branches and would like to keep the amount of branches I use down but I feel some will be needed here and am curious about the most efficient way to go about solving this problem.

Upvotes: 1

Views: 1185

Answers (1)

menjaraz
menjaraz

Reputation: 7575

Wikipedia entries on Board representation and Bitboard provide good explanation on the topic.

Moreover, they contain a bunch of interesting links pointing to valuable references.

I particularly advise you to study Crafty's source code. It was written by a well known authority: Dr.Robert Hyatt.

Upvotes: 2

Related Questions