Small bug in Stockfish passed pawn evaluation?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

syzygy
Posts: 5563
Joined: Tue Feb 28, 2012 11:56 pm

Re: Small bug in Stockfish passed pawn evaluation?

Post by syzygy »

Joost Buijs wrote:
Joerg Oster wrote: That's quite funny, because for me as a non-programmer this was rather easy to understand.
And I find it far better readable code than to always write "SquareBB[square]" ...
For a programmer it is just counterintuitive, and it doesn't serve any purpose.
The & operator is defined to do a bitwise and, when you overload it and give it a different meaning this is very confusing.
It is not a different meaning, just a way of bitwise anding a bitboard with a single square.

Of course it is confusing the first time you dive into SF code and see this construct, but it is normal that you need to get to know the code a bit.