Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: checks in qsearch

Author: Vincent Diepeveen

Date: 14:36:37 10/30/02

Go up one level in this thread


On October 30, 2002 at 09:07:26, Tony Werten wrote:

>On October 30, 2002 at 08:47:34, Heiner Marxen wrote:
>
>>On October 30, 2002 at 07:50:53, Gerd Isenberg wrote:
>>
>>><snip>
>>>>>int looprichting[7][64][64];
>>>>>
>>>>>of course only elements 1..5 get used practical for this check
>>>>>generation so it is:
>>>>>  5 * 4096 * 4 = 80KB
>>>>
>>>>It might be worth it to convert the 2 squares to 0x88 representation here and
>>>>only need 5 * 239 * 4 = 4.78 KB ?
>>>>
>>>>Tony
>>>
>>>Hi Tony,
>>>
>>>That looks interesting. Can you help me a bit to understand the 239?
>>>
>>>Thank in advance,
>>>Gerd
>>
>>That is 0x77*2 + 1.  Feel better now?  :-))
>>
>>With 0x88 coordinates (minimum used value = 0, maximum = 0x77 (inclusive))
>>one interesting property is, that the difference of two such values uniquely
>>determines the geometric relationship.
>>Hence, a table covering all possible differences is enough.
>>
>>What differences can occur?  (0..0x77) - (0..0x77) --> (-0x77 .. +0x77)
>>That range turns out to be 239 (== 0xef).
>
>In addition:
>
>The idea wich makes 0x88 nice is that  dir(piece,square_from-square_to) is a
>constant.

the advantage of 0x88 shows basically in assembly where you can replace
branches by a bunch of P6 instructions.

It is trivially faster than bitboards.

>So a move might be a discovered check only if
>dir(queen,square_from-square_king)!=0 and
>abs(dir(queen,square_from-square_king))!= abs(dir(piece,square_from-square_to))

>Tony

>>I use this property in Chest.

>>Cheers,
>>Heiner



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.