]> git.sesse.net Git - stockfish/commitdiff
Don't clear hash at the beginning of a new game
authorMarco Costalba <mcostalba@gmail.com>
Tue, 1 Dec 2009 10:56:48 +0000 (11:56 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 2 Dec 2009 14:13:13 +0000 (15:13 +0100)
After 900 games at 1+0
Mod vs Orig +217 =480 -196 +8 ELO

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

index 5bbc0abd2d58514870af54133786b3595dcdc563..b47b8b243e85d2cc1b0c69828f9b726a0afd2948 100644 (file)
@@ -402,13 +402,13 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
   Problem = false;
   ExactMaxTime = maxTime;
 
+  if (button_was_pressed("New Game"))
+      loseOnTime = false; // reset at the beginning of a new game
+
   // Read UCI option values
   TT.set_size(get_option_value_int("Hash"));
   if (button_was_pressed("Clear Hash"))
-  {
       TT.clear();
-      loseOnTime = false; // reset at the beginning of a new game
-  }
 
   bool PonderingEnabled = get_option_value_bool("Ponder");
   MultiPV = get_option_value_int("MultiPV");
index 69de2fb1fe4daa5bf43bbd1dc4136c05c6ebda22..c4c1a03705924516558ac8c5651b7bd63bc13bf5 100644 (file)
@@ -124,7 +124,7 @@ namespace {
     }
     else if (token == "ucinewgame")
     {
-        push_button("Clear Hash");
+        push_button("New Game");
         Position::init_piece_square_tables();
         RootPosition.from_fen(StartPosition);
     }
index d1326a4c9be0b8c76f1bd86f79c5faf3d720abc3..2185edf07c881ab6fe694fa6d2cfc5a44f6f9742 100644 (file)
@@ -125,6 +125,7 @@ namespace {
     o["Threads"] = Option(1, 1, 8);
     o["Hash"] = Option(32, 4, 4096);
     o["Clear Hash"] = Option(false, BUTTON);
+    o["New Game"] = Option(false, BUTTON);
     o["Ponder"] = Option(true);
     o["OwnBook"] = Option(true);
     o["MultiPV"] = Option(1, 1, 500);