Closed an-inconspicuous-semicolon closed 1 year ago
what's wrong with IsWhiteToMove ? -1 : 1
It's that I believe that IsWhiteToMoveInt
is identical to IsWhiteToMove
in functionality, but since you will need it in quite a few places, having to spend an extra 5+ tokens every time makes the problem slightly harder for no good reason, similar to #380. Having to either recalculate the value everywhere it is used, or pass it through call trees. when the same information is already presented by the Board
class, is in my opinion, sub-optimal
Whilst the
IsWhiteToMove
can be used in boolean logic to determine the colour that is moving, math cannot.IsWhiteToMoveInt
will fix this by enabling bots to get a number they can multiply against.For example, when using a numerical evaluation that has white as positive, the bot can multiply against
IsWhiteToMoveInt
at each step in the search tree to find if the evaluation is better for the current player or opponent.