Gull

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

outAtime
Posts: 226
Joined: Sun Mar 08, 2009 3:08 pm
Location: Canada

Gull

Post by outAtime »

Having a look at Gull and noticed some strange mobility code for bishops..

Code: Select all

score += choose_popcnt<HPopCnt>((~Board->bb&#91;White&#93;) & att & BishopMajorWhite&#41; * BishopMobMajor 
where BishopMajorWhite is:

Code: Select all

#define BishopMajorWhite Convert&#40;0x7EFFFF7E3C000000,uint64&#41;
Can anyone explain what is being counted here?
outAtime
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Gull

Post by Gerd Isenberg »

outAtime wrote:Having a look at Gull and noticed some strange mobility code for bishops..

Code: Select all

score += choose_popcnt<HPopCnt>((~Board->bb&#91;White&#93;) & att & BishopMajorWhite&#41; * BishopMobMajor 
where BishopMajorWhite is:

Code: Select all

#define BishopMajorWhite Convert&#40;0x7EFFFF7E3C000000,uint64&#41;
Can anyone explain what is being counted here?
It seems to count the number of squares attacked by white bishop(s), not occupied by own pieces and restricted to this area of 32 squares for forward mobility:

Code: Select all

0x7EFFFF7E3C000000

 . 1 1 1 1 1 1 .
 1 1 1 1 1 1 1 1
 1 1 1 1 1 1 1 1
 . 1 1 1 1 1 1 .
 . . 1 1 1 1 . .
 . . . . . . . .
 . . . . . . . .
 . . . . . . . .
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Gull

Post by Dann Corbit »

outAtime wrote:Having a look at Gull and noticed some strange mobility code for bishops..

Code: Select all

score += choose_popcnt<HPopCnt>((~Board->bb&#91;White&#93;) & att & BishopMajorWhite&#41; * BishopMobMajor 
where BishopMajorWhite is:

Code: Select all

#define BishopMajorWhite Convert&#40;0x7EFFFF7E3C000000,uint64&#41;

Can anyone explain what is being counted here?
Here is BishopMajorWhite :

Code: Select all

01111110
11111111
11111111
01111110
00111100
00000000
00000000
00000000