Computer Chess Club Archives


Search

Terms

Messages

Subject: Bitboards verses Offsets ?

Author: Ron Peterson

Date: 07:58:17 10/16/04


     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.  I
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.01 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.