Author: Robert Hyatt
Date: 12:16:11 07/18/02
Go up one level in this thread
On July 18, 2002 at 13:39:01, Steffen Jakob wrote:
>On July 18, 2002 at 13:23:23, Robert Hyatt wrote:
>
>>On July 18, 2002 at 12:21:26, Steffen Jakob wrote:
>>
>>>Hi Bob!
>>>
>>>On July 18, 2002 at 12:16:55, Robert Hyatt wrote:
>>>
>>>>
>>>>Extensions was a debugging tool. IE I used to have a parallel array with
>>>>the PV in one element and the extensions for that ply in another. Then when
>>>>I dumped the PV I could see which plies had extensions applied. I took that
>>>>out a long time back to save the time of backing up the stuff when I really
>>>>didn't care except on rare occasions during debugging.
>>>>
>>>>The rest are simply carry-overs. To me a&7 is clearer than a&CONST where I
>>>>might not remember which bits are on in CONST...
>>>
>>>I didn't think of making 7 const but something like this (from hossa-3.0 (aka
>>>Jockel@ICC) source):
>>>
>>>template <typename T> inline File getFile(const T &s) {
>>> return static_cast<File>(static_cast<unsigned int>(s) & 7);
>>>}
>>>template <typename T> inline Rank getRank(const T &s) {
>>> return static_cast<Rank>(static_cast<unsigned int>(s) >> 3);
>>>}
>>>
>>>or in C-world code
>>>#define getFile(s) ((s)&7)
>>>#define getRank(s) ((s)>>3)
>>>
>>>Greetings,
>>>Steffen.
>>
>>
>>I already do this. I have "Rank()" and "File()" macros that I use most
>>everywhere already. Ditto for "From()", "To()", "Piece()", "Captured()" to
>>extract that field from the 21 bit compressed move format I use internally.
>
><nitpicking>
>crafty> egrep '&7\)|>>3\)' *.[ch] | grep -v '#define' | wc --lines
> 23
></nitpicking>
>
>Best wishes,
>Steffen.
your egrep is NFG. If you look, many of those are in init.c and in the
chess.h file where the File() is actually defined using that pattern. :)
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.