diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index 98ff360..27b428d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,10 +8,10 @@ #include "board/board.hpp" #include "board/fen.hpp" +#include "hash.hpp" #include "misc.hpp" #include "moves.hpp" #include "uci.hpp" -#include "zobrist.hpp" static void perft(int argc, char *argv[]) { if (argc < 4 || std::string(argv[1]) != "perft") { @@ -49,9 +49,9 @@ static void perft(int argc, char *argv[]) { std::cout << oss.str() << "\n"; } -static void zobristCmd(int argc, char *argv[]) { - if (argc < 3 || std::string(argv[1]) != "zobrist") { - std::cout << "Usage: ./mono zobrist <fen> [moves...]\n"; +static void hashCmd(int argc, char *argv[]) { + if (argc < 3) { + std::cout << "Usage: ./mono hash <fen> [moves...]\n"; exit(1); } @@ -65,7 +65,7 @@ static void zobristCmd(int argc, char *argv[]) { auto start = std::chrono::steady_clock::now(); - uint64_t hash = GenerateZobristKey(&game); + uint64_t hash = GenerateHashFromScratch(&game); auto end = std::chrono::steady_clock::now(); auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(end - start) .count(); @@ -76,7 +76,7 @@ static void zobristCmd(int argc, char *argv[]) { } int main(int argc, char *argv[]) { - InitZobrist(); + InitHashing(); initMagicBitboards(); if (argc >= 2 && std::string(argv[1]) == "perft") { @@ -84,11 +84,15 @@ int main(int argc, char *argv[]) { return 0; } - if (argc >= 2 && std::string(argv[1]) == "zobrist") { - zobristCmd(argc, argv); + if (argc >= 2 && std::string(argv[1]) == "hash") { + hashCmd(argc, argv); return 0; } + if (argc != 1) { + std::cout << "Usage: ./mono \n"; + return 0; + } std::cerr << engine_info(); Uci(); return 0; |
