HIARCS Chess Forums Forum Index HIARCS Chess Forums
World Championship winning computer chess software program & downloads for chess database, analysis and play on PC, Mac and iPhone
 
 QuestionsQuestions   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Private MessagesPrivate Messages   Log inLog in 

Bitboard Query ??

 
Post new topic   Reply to topic    HIARCS Chess Forums Forum Index -> Programming Discussions
View previous topic :: View next topic  
Author
jashwant



Joined: 30 Oct 2010
Posts: 1

PostPosted: Sat Oct 30, 2010 3:20 pm    Post subject: Bitboard Query ?? Reply with quote

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....
Back to top
View user's profile Send private message
Michael Sherwin
Member


Joined: 03 Dec 2010
Posts: 4

PostPosted: Sat Dec 04, 2010 6:07 pm    Post subject: Re: Bitboard Query ?? Reply with quote

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];
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    HIARCS Chess Forums Forum Index -> Programming Discussions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP