Small bug in Stockfish passed pawn evaluation?

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Posts: 4476
Joined: Tue Feb 28, 2012 10:56 pm

Re: Small bug in Stockfish passed pawn evaluation?

Post by syzygy » Fri Jul 10, 2015 7:48 pm

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.

Post Reply