Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: algorithm question

Author: Sune Fischer

Date: 14:13:50 09/10/02

Go up one level in this thread


On September 10, 2002 at 15:22:49, Uri Blass wrote:

>On September 10, 2002 at 14:29:57, Sune Fischer wrote:
>
>>On September 10, 2002 at 14:15:37, Uri Blass wrote:
>>>
>>>I do not understand your example
>>
>>hmm :)
>>
>>all right, the clasic draw then:
>>
>>[D]8/3k4/8/p1p1p1p1/PpPpPpPp/1P1P1P1P/8/1B2K3 w - - 0 1
>>
>>There is no progress possible, most programs are pretty stypid here and can't
>>even see it by search.
>>
>>-S.
>
>I do not see how the idea that was posted help.

You can use it to see, that your king (the winning side) can't get close to the
opponent, in fact white can't even threaten any of blacks pieces.

This is not enough, one also needs to see that no pawns can move.

Unless there is some zugzwang, I think this is draw in any case.

It has other applications as well, eg.

sq2 bitmap (center squares)
00000000
00000000
00000000
00011000
00011000
00000000
00000000
00000000

path bitmap (inversed black pawns)
11111111
11011000
10110111
11111111
11111111
11111111
11111111
11111111

sq1: (the trapped white bishop)
00000000
10000000
00000000
00000000
00000000
00000000
00000000
00000000

now, see if sq1 and sq2 are diagonally connected with:

bool IsDiagonalConnected(BITBOARD path,BITBOARD sq1,BITBOARD sq2) {
 int n=0;

 if (!(sq1&=path) || !(sq2&=path))
	return false;

 register BITBOARD old_sq1;
 while(1) {
	if (sq1&sq2)
		return true;               // Found a good path
	old_sq1=sq1;
	sq1|=SHIFTUPRIGHT(sq1)|SHIFTUPLEFT(sq1);
	sq1&=path;
	sq1|=SHIFTDOWNRIGHT(sq1)|SHIFTDOWNLEFT(sq1);
	sq1&=path;
	if (sq1==old_sq1)
	  return false;            // Fill has stopped
 }
}

The test will show they are not, so the bishop is trapped by enemy pawns.


>What is the relevant bitboard here
>and how do you calculate it?

bitboard technique: OR the occupied w_pawns with attacks of b_pawns.

-S.

>Uri



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.