Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 0x88 revisited

Author: Angrim

Date: 18:30:50 11/04/02

Go up one level in this thread


On November 01, 2002 at 23:40:37, Dann Corbit wrote:

>On November 01, 2002 at 22:23:49, Russell Reagan wrote:
>
>>Maybe someone can give this example in C/C++? The pascal doesn't mean much to
>>me.
>
>unsigned int can_attack[6][9];
>// 6 by 238 element array
>unsigned int attack_dir [6][0x77 + 0x77]; // must use 0x77 as a constant offset
>in C++, since we don't have arrays other than zero based unless you make your
>own class to handle it and overload []
>
>can Piece on SquareA attack SquareB?
>
>tmp = SquareA - SquareB + 0x77;
>probe = tmp >> 5;
>bittest = 1 << (probe && 31);

hmm, would you happen to mean:
bittest = 1 << (tmp && 31);

>if (can_attack[piece][probe] && bittest) {
>  //piece can potentially attack SquareB
>  // if piece is slider then only now you have to probe
>  // the big table attack_dir and check if there are blocking pieces
>}

Angrim



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.