Author: Gian-Carlo Pascutto
Date: 03:00:08 06/07/02
Go up one level in this thread
On June 06, 2002 at 19:47:14, Vincent Diepeveen wrote:
>Not really. the problem is the bitboarders have a different goal it seems.
>If all you want is a Sum(squaresattacked) as mobility function, then sure
>bitboards are an interesting thing to use at 64 bits processors. If you want
>more, then bad luck with bitboards. Factor 2 slower.
BitBoard Mobility function weighting each square differently:
int RookMobility(int square)
{
int mob, from = nobit_to_bit[square];
int mask;
mask = ((WhitePieces | BlackPieces) >> (Rank(from)<<3)) & FullRank;
mob = Rook_MobilityRank[from][mask];
mask = (R90 >> (File(from)<<3)) & FullRank;
mob += Rook_MobilityFile[from][mask];
return mob;
}
BitBoard Mobility function for Sum(squaresattacked):
int RookMobility(int square)
{
int mob, from = nobit_to_bit[square];
int mask;
mask = ((WhitePieces | BlackPieces) >> (Rank(from)<<3)) & FullRank;
mob = Rook_MobilityRank[from][mask];
mask = (R90 >> (File(from)<<3)) & FullRank;
mob += Rook_MobilityFile[from][mask];
return mob;
}
Oh, oops, guess what: they're exactly the same. The cleverness
(and difference) is in a loop that is executed once at program startup
to set up those arrays.
--
GCP
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.