Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboards need help

Author: Gerd Isenberg

Date: 11:31:14 10/28/02

Go up one level in this thread


On October 26, 2002 at 04:37:06, René Pickhardt wrote:

>Hi everybody,
>in my actual chess program I use a 2d matrix of short to represent the board.
>this is way to slow and uses too much memory so I wanted to change my engine to
>bitboards. I found a pretty good link about bit boards
>http://www.galahadnet.com/chess/chessprg/bitboard.htm
>but I really do not understand how I represent a board by using bitboards. I
>understand the idea but I have no idea where to start, does anybody have any
>good links about bitboards or good tutorials maybe even with examples
>thanks rené

Hi rené,

the (bit)board representation is distributet on several bitboards (i prefere six
piece-bitboards and two bitboards for all pieces for each color). Therefore many
bitboard-programs do have a redundant board representation with an array of
chars, shorts or ints. Without this, you have to probe several bitboards, doing
some conditional jumps or combining the bits with some shift and other logical
operations, to get a piece code of one square.

The piece-code is required for updating the piece bitboards by doing/undoing
moves and even two piece-codes are needed if pieces get captured. Instead of
getting the piece-codes via square coordinates from the bitboards or the board
array, it is also possible to combine the information of the moving and captured
piece (if any) inside the _move_ code. But that requires some effort during the
move-generation. On the other hand, traversing bitboards of one kind of target
piece for capture generation considering most valuable first may have some
(bookholding) advantages.

Regards,
Gerd



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.