From: Marco Costalba Date: Thu, 30 Dec 2010 10:46:53 +0000 (+0100) Subject: Better document value_to_uci() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=6f2e4c006cbfe8f6ec5056e991892e3b35a30443 Better document value_to_uci() No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index 46287c47..771963fb 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1948,14 +1948,19 @@ split_point_start: // At split points actual search starts from here } - // value_to_uci() converts a value to a string suitable for use with the UCI protocol + // value_to_uci() converts a value to a string suitable for use with the UCI + // protocol specifications: + // + // cp The score from the engine's point of view in centipawns. + // mate Mate in y moves, not plies. If the engine is getting mated + // use negative values for y. std::string value_to_uci(Value v) { std::stringstream s; if (abs(v) < VALUE_MATE - PLY_MAX * ONE_PLY) - s << "cp " << int(v) * 100 / int(PawnValueMidgame); // Scale to pawn = 100 + s << "cp " << int(v) * 100 / int(PawnValueMidgame); // Scale to centipawns else s << "mate " << (v > 0 ? (VALUE_MATE - v + 1) / 2 : -(VALUE_MATE + v) / 2 );