Bitboard Query ??

You can discuss all aspects of programming and technical matters here.

Moderators: Harvey Williamson, Watchman

Post Reply
jashwant
Posts: 1
Joined: Sat Oct 30, 2010 3:03 pm

Bitboard Query ??

Post by jashwant »

I've just started to develope a chess engine. I've read about bitboards and now I know that I need many bitboards to maintain my chess engine. I knew about generating moves for pawns. I understand that I need an array knight[64] for knight moves for storing 64 bitboards for every chessboard position. Same for King. I understand rotated bitboards.It needs a 2d array of [64[64],for storing every possible combination.

(Correct me wherever I am wrong )

Now, I've got few problems before I can start writing my code.

1. How can I get the position of my pieces in bitboards ? (for example, how can I know where my knight is placed right now among the 64 positions ? ( I need to calculate positions of all 4 knights in decimal no)


more queries to follow....
Michael Sherwin
Member
Posts: 4
Joined: Fri Dec 03, 2010 11:39 pm

Re: Bitboard Query ??

Post by Michael Sherwin »

jashwant wrote:I've just started to develope a chess engine. I've read about bitboards and now I know that I need many bitboards to maintain my chess engine. I knew about generating moves for pawns. I understand that I need an array knight[64] for knight moves for storing 64 bitboards for every chessboard position. Same for King. I understand rotated bitboards.It needs a 2d array of [64[64],for storing every possible combination.

(Correct me wherever I am wrong )

Now, I've got few problems before I can start writing my code.

1. How can I get the position of my pieces in bitboards ? (for example, how can I know where my knight is placed right now among the 64 positions ? ( I need to calculate positions of all 4 knights in decimal no)


more queries to follow....
You need a FEN parser/loader and an original position FEN to make a board array. You then interrogate the board array to make your piece maps (bitboards). So, a N on g1 gets into the Knight map like this, U64 wKnights = wKnights | (1 << sq); or faster wKnights = wKnights | setBit[sq];
Post Reply