From 7ac54f2ebb9778f2eb3bc18e7937d000b39ecf84 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 29 Jul 2026 19:59:21 +0200 Subject: adding load and save for transpotion table --- src/uci.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/uci.cpp b/src/uci.cpp index e6aec4e..dc595b5 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -103,7 +103,6 @@ void Uci() { Game game = initBoard("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", &transpositions); - LoadTable("cache/positions.txt", &transpositions); string line; while (getline(cin, line)) { @@ -114,6 +113,16 @@ void Uci() { if (cmd == "quit") { break; } + if (cmd == "save") { + SaveTranspositionTable(transpositions); + cout << "done\n"; + cout.flush(); + } + if (cmd == "load") { + LoadTable("cache/positions.txt", &transpositions); + cout << "done\n"; + cout.flush(); + } if (cmd == "uci") { cout << "uciok\n"; cout.flush(); @@ -166,7 +175,6 @@ void Uci() { } cout << "\n"; - SaveTranspositionTable(transpositions); cout.flush(); } else if (cmd.starts_with("position")) { stringstream ss(line); -- cgit v1.2.3