Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Question for Gerd: reduce rbb lookup tables

Author: Russell Reagan

Date: 08:38:31 07/15/03

Go up one level in this thread


On July 14, 2003 at 18:20:33, Tim Foden wrote:

>inline int  Rank( Sq sq )                   { return sq >> 3; }
>inline int  File( Sq sq )                   { return sq & 0x7; }
>
>inline BYTE     PatMoves( int rf, int pat )
>                                    { return CStatics::s_patMoves[rf][pat]; }
>inline UINT64   ExtVert( int pat )  { return CStatics::s_extendVert[pat]; }
>inline UINT64   ExtHorz( int pat )  { return CStatics::s_extendHorz[pat]; }
>
>inline UINT64   RankMask( int r )   { return CStatics::s_rankMask[r]; }
>inline UINT64   FileMask( int f )   { return CStatics::s_fileMask[f]; }
>
>inline UINT64   CBoard::GenRAttacksBitmap( Sq sq ) const
>{
>    int     r = Rank(sq);
>    int     f = File(sq);
>    BYTE    movesR = PatMoves(f, m_rot[cHorz].bytes[r]);
>    BYTE    movesF = PatMoves(r, m_rot[cVert].bytes[f]);
>    UINT64  bitmap = (ExtVert(movesR) & RankMask(r)) |
>                     (ExtHorz(movesF) & FileMask(f));
>    return bitmap;
>}

Hi Tim,

This is very cool. I had to sit here staring at the screen to figure out what
you were doing at first, but soon light bulbs started going off, and I saw how
neat, simple, and clean this is.

One question though. How do you compute the diagonal attacks with such small
tables (15 entries each!)?



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.