Author: José Carlos
Date: 14:44:36 08/26/05
Go up one level in this thread
On August 26, 2005 at 15:04:55, Robert Hyatt wrote:
>I'm fixing to change the way I number bits to make bit 0 the LSB (as the BSF/BSR
>instructions count on the X86) rather than the MSB as the leading zero
>instruction counts on the Cray-1 architecture.
>
>I have four choices for which square bit 0 represents (four logical choices,
>anyway, I guess one could number bits randomly should they choose).
>
>A1 = 0
>H1 = 0
>A8 = 0
>H8 = 0
>
>For those of you using bitboards, which did you use? Since it doesn't matter to
>me at all, since I am having to rewrite a bunch of stuff to make this work, I
>thought I would try to match the most common layout which will make the programs
>more compatible if we share any ideas.
>
>I am leaning toward H1 = 0, H2 = 8, ..., H8 = 56 and A8 = 63, but I've not made
>any decision yet... The reason for this is that it is easier to visualize if
>you think of the chess board as being composed of the 1 rank and the rightmost 8
>bits of the bitboard, the 2nd rank is the next 8 bits, etc.
>
>The alternative is H8=0, etc, so that the last rank is the rightmost bits, the
>seventh rank is the next 8 bits, etc. Anything else requires "mentally
>mirroring" so that if A1 or A8 is bit zero, the bits are backward, since A8 is
>the left end of a rank, and bit 0 is the right end of a set of 8 bits...
In Anubis (non rotated bitboards) I have H1 = 0 so that I can visualize the
board easily and have some pstables like this:
static const SINT8 as8psCaballo[] =
{
-25,-15,-15,-10,-10,-15,-15,-25,
-10, -4, -2, 0, 0, -2, -4,-10,
-4, 0, 5, 3, 3, 5, 0, -4,
-2, 1, 5, 8, 8, 6, 1, -2,
-2, 1, 5, 8, 8, 6, 1, -2,
-4, 1, 6, 3, 3, 6, 1, -4,
-6, -1, -1, 0, 0, -1, -1, -6,
-20,-10, -4, -2, -2, -4,-10,-20
};
It is knight eval.
I also have a translate-to-black table like this:
static const SINT8 as8Negras[] = // Tabla para traducir coordenadas y reducir
espacio
{
56,57,58,59,60,61,62,63,
48,49,50,51,52,53,54,55,
40,41,42,43,44,45,46,47,
32,33,34,35,36,37,38,39,
24,25,26,27,28,29,30,31,
16,17,18,19,20,21,22,23,
8, 9,10,11,12,13,14,15,
0, 1, 2, 3, 4, 5, 6, 7
};
Seems to me the more natural way to represent the board.
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.