Skip to content

Commit e5f51e2

Browse files
committed
getEvalScore improvements
1 parent 6738da4 commit e5f51e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

JavaStockfish/src/com/rahul/stockfish/Stockfish.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,13 @@ public float getEvalScore(String fen, int waitTime) {
152152
String[] dump = getOutput(waitTime + 20).split("\n");
153153
for (int i = dump.length - 1; i >= 0; i--) {
154154
if (dump[i].startsWith("info depth ")) {
155+
try {
155156
evalScore = Float.parseFloat(dump[i].split("score cp ")[1]
156157
.split(" nodes")[0]);
158+
} catch(Exception e) {
159+
evalScore = Float.parseFloat(dump[i].split("score cp ")[1]
160+
.split(" upperbound nodes")[0]);
161+
}
157162
}
158163
}
159164
return evalScore/100;

0 commit comments

Comments
 (0)