From cc04a745e2f6aca12ac8373c85ae0ccafac07ffb Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 7 Apr 2012 12:04:03 +0100 Subject: [PATCH 1/1] Teach 'bench' to run current position Now that we can call bench from command prompt has a sense to teach bench to run the current set position. To do this is enough to call bench with 'current' as fen source parameter. No functional change. Signed-off-by: Marco Costalba --- src/benchmark.cpp | 7 ++++++- src/uci.cpp | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/benchmark.cpp b/src/benchmark.cpp index 67902062..0417313c 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -83,7 +83,12 @@ void benchmark(istringstream& is) { else limits.depth = atoi(limit.c_str()); - if (fenFile != "default") + if (fenFile == "current") + { + fens.clear(); + fens.push_back(Search::RootPosition.to_fen()); + } + else if (fenFile != "default") { fens.clear(); string fen; diff --git a/src/uci.cpp b/src/uci.cpp index 126cd5c4..96aae854 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -59,6 +59,8 @@ void uci_loop(const string& args) { Position pos(StartFEN, false, Threads.main_thread()); // The root position string cmd, token; + Search::RootPosition = pos; + while (token != "quit") { if (!args.empty()) -- 2.39.2