Bot thinks it's checkmating #185
-
I'm not sure if I'm just crazy but this code int checkmateMultiplier = board.IsWhiteToMove ? 1 : -1;
if (board.IsInCheckmate())
{
evaluation = int.MinValue * checkmateMultiplier;
} makes it so when I checkmate the bot, the console prints
the right number being the evaluation (positive: white is winning, negative: black is winning). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
int.MinValue can retain its negative value even when multiplied by negative number. I had half of my day destroyed by the same problem. |
Beta Was this translation helpful? Give feedback.
int.MinValue can retain its negative value even when multiplied by negative number.
To be sure there are no bugs like that, use large numbers as max/min values, i.e 99999 and -99999 correspondingly.
For chess evaluation purposes those numbers should suffice.
I had half of my day destroyed by the same problem.