Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: My humble experience with bitboards

Author: José Carlos

Date: 03:53:14 11/28/02

Go up one level in this thread


On November 28, 2002 at 05:05:12, David Rasmussen wrote:

>On November 27, 2002 at 19:03:38, José Carlos wrote:
>
>>  I've been writing a new program in the last few weeks (at about 4-5 hours a
>>week). I wanted to experience with bitboards (non rotated) and MTD(f).
>
>What non-rotated scheme are you using?
>How do you get, for example, rook attack information?
>
>/David

  I go for the easy way now, and wait for optimizing speed (or rewrite the
program for speed) later.
  My rook moves looks like this (there might be typos because I'm writing from
memory):

u64Pieza = pPos->u64TorresB | pPos->u64DamasB; // Rooks | Queens
while (u64Pieza)
{
	u16Desde = PrimerUno(u64Pieza); // First one
	BB_InvertirBit(&u64Pieza,u16Desde); // Clear bit
	u64Destinos = au64AtaquesTorre[u16Desde] & u64Vacias; // Rook attacks & empty
	while (u64Destinos)
	{
		u16Hasta = PrimerUno(u64Destinos); // First one
		BB_InvertirBit(&u64Destinos,u16Hasta); // Clear bit
		if (au64Entre[u16Desde][u16Hasta] & u64Todas)
			continue; // There's something between from and to
		Jug_SetDatosMov(pJugada++,u16Desde,u16Hasta,0); // Add move
	}
}

  As you see, it's not written for speed. It's just my first approach to
bitboards world.

  José C.



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.