Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboards verses Offsets ?

Author: Stuart Cracraft

Date: 11:19:53 10/16/04

Go up one level in this thread


On October 16, 2004 at 10:58:17, Ron Peterson wrote:

>     I have seen some messeages about the use of bitboards for move generation.
>I use a offset approch for my move generator and I am pleased with the speed.


Where bitboard really shines is in evaluation. You can do a lot more
evaluation at better speeds of more complex board issues in less time
and with less thinking and cleaner code using bitboards than anything
else.

For a couple implementations, see GNU Chess and Crafty.

To avoid the complexity of implementing bitboard move generation but
get part of the benefits of bitboard evaluation, I maintain bitboard
long long's for piece location, update these during the makemove/unmakemove,
and then use them for evaluation.

I still my old attack routine and am happy with the hybrid.

The above refers to my personal program. The above two public programs
have considerably larger implementations for bitboard.

Stuart

>have enclosed a copy of my "gen_white_knight" code.
>     My question is what type of speed increase wuold you expect to get in a
>move generator using bitboard?  50%?  100%?
>     Thanks
>
>The following function accepts the next empty index for storage in an array of
>structures database.  It returns the next empty spot after all knight moves have
>been calculated or -1 if the enemy king has been taken.
>
>gen_white_knight(int i,int j,int count,int ply)
>{
>
>	int k,l,increment;
>
>	for (increment=0; increment<16; increment+=2)
>	{
>		k = i + n_offset[increment]; /*static data table for offsets*/
>		l = j + n_offset[increment + 1];
>		switch (board[k][l])
>		{
>			case EMPTY:
>			case BLACK_PAWN:
>			case BLACK_KNIGHT:
>			case BLACK_BISHOP:
>			case BLACK_ROOK:
>			case BLACK_QUEEN:    store_move(i,j,k,l,0,count++,ply);
>								break;
>			case BLACK_KING:	return -1;
>								break;
>			default:			break;
>		}
>	}
>	return count;
>}




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.