]> git.sesse.net Git - stockfish/commitdiff
Better document value_to_uci()
authorMarco Costalba <mcostalba@gmail.com>
Thu, 30 Dec 2010 10:46:53 +0000 (11:46 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 30 Dec 2010 10:46:53 +0000 (11:46 +0100)
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 46287c471cbfadd0d11172d87ca7bb862f51e947..771963fbb98cca6d4f6ec7770f36a2c05b17658c 100644 (file)
@@ -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 <x>     The score from the engine's point of view in centipawns.
+  // mate <y>   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)
 
   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 );
 
     else
       s << "mate " << (v > 0 ? (VALUE_MATE - v + 1) / 2 : -(VALUE_MATE + v) / 2 );