Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: algorithm question

Author: Gerd Isenberg

Date: 12:04:04 09/10/02

Go up one level in this thread


On September 10, 2002 at 13:22:59, Uri Blass wrote:

>On September 09, 2002 at 19:01:17, Gerd Isenberg wrote:
>
>>On September 09, 2002 at 18:39:51, Vincent Diepeveen wrote:
>>
>>>On September 09, 2002 at 16:13:00, Gerd Isenberg wrote:
>>>
>>>Hello,
>>>
>>>Just to be clear is the next path a legal one:
>>> isconnected(d4,d8) ==>
>>>  d4 e3 d1 c1 b2 a3 a4 a5 b6 c6 d6 e6 f7 e8 d8
>>
>>Yes, Vincent, exactly.
>>
>>With the following bitboard
>>
>>0x18201e010911221c
>>
>>0 0 0 1 1 0 0 0  18
>>0 0 0 0 0 1 0 0  20
>>0 1 1 1 1 0 0 0  1e
>>1 0 0 0 0 0 0 0  01
>>1 0 0 1 0 0 0 0  09
>>1 0 0 0 1 0 0 0  11
>>0 1 0 0 0 1 0 0  22
>>0 0 1 1 1 0 0 0  1c
>
>How do you get that bitboard?
>
>
>I do not understand why do you choose 1 for d4 and e3.
>
>d4 and e3 are controlled by black pawns so they cannot be squares that white
>piece is going to go.
>

Hi Uri,

the above bitboard was not related to the initial position, rather than to
Vincents sample path.


>I can think of a similiar path as a path for the white king.
>
>Another question is how do you plan to know the squares that are safe for the
>white king in the diagram.
>
>Evaluating this seems to me the main expensive problem and not calculating if
>2 squares are connected.
>
>Uri

I agree, but in endgames with unequal colored bishops or with blocked or
otherwise unmovable pawns there are some chanches.

Here the black king is stalemated forever, no pawn is able to move on a light
colored square without being captured and there is only a dark colored black
bishop.

So you can include all light squares and the square the WK is curently on,
exluding the adjacent black king squares and own pawn/pieces, safely into the
path-set to fill the flood from a1 to c8.

btw: the flood filler introduced by Steffan Westcott is about 3-4 times faster,
than my dumb recursive (inlined shift, measured in a loop with 10,000,000*2
calls to isConnected with rather patological path bitboards from my example, one
with 13 iterations the other with 29!).

Regards,
Gerd




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.