Author: Mikael Bäckman
Date: 14:25:49 03/24/04
Go up one level in this thread
On March 24, 2004 at 16:58:02, Andreas Guettinger wrote:
>On March 24, 2004 at 15:23:26, Dann Corbit wrote:
>
>>A lot of people seem to use the 16x8 board with 0x88.
>>
>>Very vew people seem to use the other half for anything useful.
>>
>>I am wondering, does anyone use the other half of the board to store data about
>>the square it duplicates?
>>
>>Seems like a very obvious enhancement to me.
>
>Interestingly I had exactly the same thoughts some days ago.
>
>I looked at some of my arrays[FIELDS] for piece values, mobility values etc
>where the right part of the tables are always empty. I wondered if you could not
>just put the values for white in the left half, the values for black in the
>right hlaf of the tables and just use (sq+8) to access the values for black?
>
>regards
>Andy
I do this for my evaluation piecesquare values and attacktables. It works fine,
but the code can get rather difficult to read. For example here's a bit of
Cheplas kingsafety code which tests who controls the '2 forward' squares:
sq = kingSq[1];
if (OnBoard(sq + N + N)) {
t = attCount[sq+N+N+8] - attCount[sq+N+N];
if (t > 0) ac += t;
if (OnBoard(sq + N + NW)) {
t = attCount[sq+N+NW+8] - attCount[sq+N+NW];
if (t > 0) ac += t;
}
if (OnBoard(sq + N + NE)) {
t = attCount[sq+N+NE+8] - attCount[sq+N+NE];
if (t > 0) ac += t;
}
}
That '+8' is so easy to forget...
/Mikael
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.