MCPcopy Create free account
hub / github.com/cutechess/cutechess / evalString

Function evalString

projects/lib/src/chessgame.cpp:28–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace {
27
28QString evalString(const MoveEvaluation& eval)
29{
30 if (eval.isBookEval())
31 return "book";
32 if (eval.isEmpty())
33 return QString();
34
35 QString str = eval.scoreText();
36 if (eval.depth() > 0)
37 str += "/" + QString::number(eval.depth()) + " ";
38
39 int t = eval.time();
40 if (t == 0)
41 return str + "0s";
42
43 int precision = 0;
44 if (t < 100)
45 precision = 3;
46 else if (t < 1000)
47 precision = 2;
48 else if (t < 10000)
49 precision = 1;
50 str += QString::number(double(t / 1000.0), 'f', precision) + 's';
51
52 return str;
53}
54
55} // anonymous namespace
56

Callers 1

onMoveMadeMethod · 0.85

Calls 6

isBookEvalMethod · 0.80
scoreTextMethod · 0.80
depthMethod · 0.80
timeMethod · 0.80
QStringClass · 0.70
isEmptyMethod · 0.45

Tested by

no test coverage detected