mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-20 12:42:18 +01:00
DroidFish: Avoid terminating space character in book info strings.
This commit is contained in:
@@ -145,15 +145,19 @@ public final class DroidBook {
|
|||||||
for (BookEntry be : bookMoves)
|
for (BookEntry be : bookMoves)
|
||||||
totalWeight += scaleWeight(be.weight);
|
totalWeight += scaleWeight(be.weight);
|
||||||
if (totalWeight <= 0) totalWeight = 1;
|
if (totalWeight <= 0) totalWeight = 1;
|
||||||
|
boolean first = true;
|
||||||
for (BookEntry be : bookMoves) {
|
for (BookEntry be : bookMoves) {
|
||||||
Move m = be.move;
|
Move m = be.move;
|
||||||
bookMoveList.add(m);
|
bookMoveList.add(m);
|
||||||
String moveStr = TextIO.moveToString(pos, m, false);
|
String moveStr = TextIO.moveToString(pos, m, false);
|
||||||
|
if (first)
|
||||||
|
first = false;
|
||||||
|
else
|
||||||
|
ret.append(' ');
|
||||||
ret.append(moveStr);
|
ret.append(moveStr);
|
||||||
ret.append(':');
|
ret.append(':');
|
||||||
int percent = (int)Math.round(scaleWeight(be.weight) * 100 / totalWeight);
|
int percent = (int)Math.round(scaleWeight(be.weight) * 100 / totalWeight);
|
||||||
ret.append(percent);
|
ret.append(percent);
|
||||||
ret.append(' ');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new Pair<String, ArrayList<Move>>(ret.toString(), bookMoveList);
|
return new Pair<String, ArrayList<Move>>(ret.toString(), bookMoveList);
|
||||||
|
|||||||
Reference in New Issue
Block a user