First thing you have to do is decide what exactly you mean by the difference of evaluation between moves, in particular, how are you going to handle mates? In principle, they should count as ±∞, but you probably will want to introduce some form of cutoff.
After that you only have pick a side to evaluate the score from (White, Black, or the current player).
Let's say you want "score" from White's perspective, and you'll cut off a mate at ±1000 cp. Then you can get an integer valued score as: "score.white().score(mate_score=1000)"
See the official docs for more info.
Hi All,
I am trying to build a python program that analyses your chess.com games, part of which is the difference between the best possible move and the ones you made.
My issue is that the python-chess library evaluates the position and returns a PovScore object I am unable to cast to an integer for comparison. I also can't directly subtract one PovScore from another.
Just wondering if anyone has tried to do something similar or has more experience with python chess engine.analyse()