diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-29 19:59:21 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-29 19:59:21 +0200 |
| commit | 7ac54f2ebb9778f2eb3bc18e7937d000b39ecf84 (patch) | |
| tree | 95495114af631e23ebdf754b5971e18068a42036 /src/uci.cpp | |
| parent | 4aac933e3c08535501558448ce43ce610b5e317f (diff) | |
adding load and save for transpotion table
Diffstat (limited to 'src/uci.cpp')
| -rw-r--r-- | src/uci.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
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); |
