Extend range of skill levels to negative values
authorFabian Fichter <ianfab@users.noreply.github.com>
Tue, 4 Feb 2020 21:15:10 +0000 (22:15 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Tue, 4 Feb 2020 21:15:10 +0000 (22:15 +0100)
src/search.cpp
src/ucioption.cpp

index 759036c..2e442a7 100644 (file)
@@ -97,7 +97,7 @@ namespace {
   struct Skill {
     explicit Skill(int l) : level(l) {}
     bool enabled() const { return level < 20; }
-    bool time_to_pick(Depth depth) const { return depth == 1 + level; }
+    bool time_to_pick(Depth depth) const { return depth == 1 + std::max(level, 0); }
     Move pick_best(size_t multiPV);
 
     int level;
index f296bb6..e29b062 100644 (file)
@@ -133,7 +133,7 @@ void init(OptionsMap& o) {
   o["Clear Hash"]            << Option(on_clear_hash);
   o["Ponder"]                << Option(false);
   o["MultiPV"]               << Option(1, 1, 500);
-  o["Skill Level"]           << Option(20, 0, 20);
+  o["Skill Level"]           << Option(20, -20, 20);
   o["Move Overhead"]         << Option(30, 0, 5000);
   o["Minimum Thinking Time"] << Option(20, 0, 5000);
   o["Slow Mover"]            << Option(84, 10, 1000);