Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 0x88 offset table

Author: GeoffW

Date: 16:48:36 10/09/04

Go up one level in this thread


Hi David

I came up with this a while back, give it a shot, the html might screw up the
formatting though ?

     Geoff



const U32 attackTable[256] =
{
/*0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15         */

  0,  0,  0,  0,  0,  0,  0,  0,  0, QB,  0,  0,  0,  0,  0,  0,  //   0- 15
 QR,  0,  0,  0,  0,  0,  0, QB,  0,  0, QB,  0,  0,  0,  0,  0,  //  16- 31
 QR,  0,  0,  0,  0,  0, QB,  0,  0,  0,  0, QB,  0,  0,  0,  0,  //  32- 47
 QR,  0,  0,  0,  0, QB,  0,  0,  0,  0,  0,  0, QB,  0,  0,  0,  //  48- 63
 QR,  0,  0,  0, QB,  0,  0,  0,  0,  0,  0,  0,  0, QB,  0,  0,  //  64- 79
 QR,  0,  0, QB,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, QB,  N,  //  80- 95
 QR,  N, QB,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  N,QBKWP,//  96-111
QRK,QBKWP,N,  0,  0,  0,  0,  0,  0, QR, QR, QR, QR, QR, QR,QRK,  // 112-127

  0,QRK, QR, QR, QR, QR, QR, QR,  0,  0,  0,  0,  0,  0,  N,QBKBP,// 128-143
QRK,QBKBP,N,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, QB,  N,  // 144-159
 QR,  N, QB,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, QB,  0,  0,  // 160-175
 QR,  0,  0, QB,  0,  0,  0,  0,  0,  0,  0,  0, QB,  0,  0,  0,  // 176-191
 QR,  0,  0,  0, QB,  0,  0,  0,  0,  0,  0, QB,  0,  0,  0,  0,  // 192-207
 QR,  0,  0,  0,  0, QB,  0,  0,  0,  0, QB,  0,  0,  0,  0,  0,  // 208-223
 QR,  0,  0,  0,  0,  0, QB,  0,  0, QB,  0,  0,  0,  0,  0,  0,  // 224-239
 QR,  0,  0,  0,  0,  0,  0, QB,  0,  0,  0,  0,  0,  0,  0,  0   // 240-255
};




const S32 rayOffsetTable[256] =
{
/*0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15         */

  0,  0,  0,  0,  0,  0,  0,  0,  0,_NW,  0,  0,  0,  0,  0,  0,  //   0- 15
 _N,  0,  0,  0,  0,  0,  0,_NE,  0,  0,_NW,  0,  0,  0,  0,  0,  //  16- 31
 _N,  0,  0,  0,  0,  0,_NE,  0,  0,  0,  0,_NW,  0,  0,  0,  0,  //  32- 47
 _N,  0,  0,  0,  0,_NE,  0,  0,  0,  0,  0,  0,_NW,  0,  0,  0,  //  48- 63
 _N,  0,  0,  0,_NE,  0,  0,  0,  0,  0,  0,  0,  0,_NW,  0,  0,  //  64- 79
 _N,  0,  0,_NE,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,_NW,  0,  //  80- 95
 _N,  0,_NE,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,_NW,  //  96-111
 _N,_NE,  0,  0,  0,  0,  0,  0,  0, _W, _W, _W, _W, _W, _W, _W,  // 112-127

  0, _E, _E, _E, _E, _E, _E, _E,  0,  0,  0,  0,  0,  0,  0,_SW,  // 128-143
 _S,_SE,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,_SW,  0,  // 144-159
 _S,  0,_SE,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,_SW,  0,  0,  // 160-175
 _S,  0,  0,_SE,  0,  0,  0,  0,  0,  0,  0,  0,_SW,  0,  0,  0,  // 176-191
 _S,  0,  0,  0,_SE,  0,  0,  0,  0,  0,  0,_SW,  0,  0,  0,  0,  // 192-207
 _S,  0,  0,  0,  0,_SE,  0,  0,  0,  0,_SW,  0,  0,  0,  0,  0,  // 208-223
 _S,  0,  0,  0,  0,  0,_SE,  0,  0,_SW,  0,  0,  0,  0,  0,  0,  // 224-239
 _S,  0,  0,  0,  0,  0,  0,_SE,  0,  0,  0,  0,  0,  0,  0,  0   // 240-255
};











On October 09, 2004 at 17:57:11, David B Weller wrote:

>For some reason I cant get this thing to work....
>
>I'm trying to initialize an offset table for 0x88 board and I keep getting stuff
>like this:
>
>0000000000000000
>1000000110000001
>1000001010000010
>1000010010000100
>1000100010001000
>1001000010010000
>1110000011100000
>1110000011100000
>0111111111111111
>1110000011100000
>1110000011100000
>1001000010010000
>1000100010001000
>1000010010000100
>1000001010000010
>1000000100000000
>
>where 1's indicate that any one of the piece-types can make that jump
>
>the left side is ok, but the right side is mirrored or something



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.