aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-08-08 18:59:53 +0200
committerAdam <adammegarules1@gmail.com>2026-08-08 18:59:53 +0200
commit2ec1de1058cb973d60e1fbd918006ab4de893c6c (patch)
tree4da9b87f92a3868db5b02e7f1f7b0c73b78d758a /src
parent0709c26bcb3f2fc5082a884efb2b7cceef1d058d (diff)
adding json output
Diffstat (limited to 'src')
-rw-r--r--src/uci.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/uci.cpp b/src/uci.cpp
index 6d2f652..0805c6c 100644
--- a/src/uci.cpp
+++ b/src/uci.cpp
@@ -306,10 +306,11 @@ void Uci() {
auto ms =
std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
.count();
- std::cout << ms << " ms\n";
- cout << count << "\n";
+ std::ostringstream oss;
+ oss << "{\"ms\": " << ms << ", \"result\": " << count << "}";
+ std::string json = oss.str();
- cout.flush();
+ std::cout << json << std::endl;
}
}
}