Help to understand something in chessprogramming wiki

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Help to understand something in chessprogramming wiki

Post by Luis Babboni »

Hi people!

I´m start to make a second vesion of Soberango and I want to use bitboards.
And I need to start from zero knowledge about bitboards.
I understood, or at least I think so, how to deal with no sliding pieces.
Now I´m trying to understand how to deal with sliding pieces.

My first question is which operation is this where I put red interrogation signs:
Image

"-" seems to be XOR as I deduced from o - s
"^" means XOR too as I deduced from o ^( o - 2s) ??!!

I think 2s could be shift bits of s one step to the msb, but anyway I cant reach that result.

In short: I need to know the meaning of : "-"; "2" and "^" in terms of AND, OR, NOT, XOR. shl (shift one bit left) and shr (shift one bit right).

Thanks!
User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: Help to understand something in chessprogramming wiki

Post by Luis Babboni »

Sorry, may be I must add the link to the chessprogramming wiki where said that:
https://www.chessprogramming.org/Effici ... ce_Attacks
You need to scroll down.
User avatar
Brunetti
Posts: 424
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Help to understand something in chessprogramming wiki

Post by Brunetti »

Luis Babboni wrote: Tue Jan 09, 2024 1:17 pm My first question is which operation is this where I put red interrogation signs:
Image
It's a subtraction. Check with decimal values:

occupied = 197
slider = 4
o-s = 193
o-2s= 189

Binary form is useful to visualize at square level.

Alex
User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: Help to understand something in chessprogramming wiki

Post by Luis Babboni »

Thanks Brunetti!!

Wow! How much I forgot about this! :oops: