aboutsummaryrefslogtreecommitdiff
path: root/src/uci.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uci.cpp')
-rw-r--r--src/uci.cpp40
1 files changed, 1 insertions, 39 deletions
diff --git a/src/uci.cpp b/src/uci.cpp
index ad1e89e..818da90 100644
--- a/src/uci.cpp
+++ b/src/uci.cpp
@@ -21,34 +21,6 @@
std::ofstream uciLog("cache/uci_log.txt", std::ios::app);
-bool LoadTable(
- const std::string &filename,
- std::unordered_map<uint64_t, TranspositionsEntry> *transpositions) {
- std::ifstream file(filename);
-
- if (!file.is_open())
- return false;
-
- uint64_t hash;
- int depth;
- int eval;
-
- while (file >> hash >> depth >> eval) {
- transpositions->operator[](hash) = {depth, eval};
- }
-
- return true;
-}
-void SaveTranspositionTable(
- const std::unordered_map<uint64_t, TranspositionsEntry> &table) {
-
- std::ofstream file("cache/positions.txt", std::ios::trunc);
-
- for (const auto &[key, value] : table) {
- file << key << ' ' << value.depth << ' ' << value.Eval << '\n';
- }
-};
-
void LogUci(const std::string &message) {
if (!uciLog.is_open()) {
return;
@@ -117,11 +89,6 @@ void Uci() {
if (cmd == "quit") {
break;
}
- if (cmd == "save") {
- SaveTranspositionTable(transpositions);
- cout << "done\n";
- cout.flush();
- }
if (cmd == "board") {
for (int rank = 0; rank < 8; rank++) {
std::printf("%d |", 8 - rank);
@@ -135,11 +102,6 @@ void Uci() {
std::printf(" | %d\n", 8 - rank);
}
}
- if (cmd == "load") {
- LoadTable("cache/positions.txt", &transpositions);
- cout << "done\n";
- cout.flush();
- }
if (cmd == "uci") {
cout << "uciok\n";
cout.flush();
@@ -166,7 +128,7 @@ void Uci() {
}
}
- Move best = EngineGetBestMove(&game, depth);
+ Move best = GetBestMove(&game, depth);
cout << "bestmove ";
cout << (char)(best.From.file + 'a') << 8 - best.From.rank