From 2ec1de1058cb973d60e1fbd918006ab4de893c6c Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 8 Aug 2026 18:59:53 +0200 Subject: adding json output --- src/uci.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/uci.cpp') 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(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; } } } -- cgit v1.2.3