I have just upgraded my code for computing completely optimally for both players a chess endgame as given here: https://pastebin.com/jQ090L01 but it gives to me 2 plies to checkmate White instead of correct 4 plies according to StockFish.
Can someone give me a hint how to fix this and where is the source of the problem? The code is correct in the sense that it detects correctly the game_tree[1]['result']: -1 for black win, 1 for white's and 0 for a draw. But it gives wrong plies to mate.ChatGPT4 hasn't helped.
I have just upgraded my code for computing completely optimally for both players a chess endgame as given here: https://pastebin.com/jQ090L01 but it gives to me 2 plies to checkmate White instead of correct 4 plies according to StockFish.
Can someone give me a hint how to fix this and where is the source of the problem? The code is correct in the sense that it detects correctly the game_tree[1]['result']: -1 for black win, 1 for white's and 0 for a draw. But it gives wrong plies to mate.ChatGPT4 hasn't helped.