diff options
| author | Adam <adammegarules1@gmail.com> | 2026-08-02 13:32:03 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-08-02 13:32:03 +0200 |
| commit | cc9fad0820d620c8a8fb609a257b82bc36b37c5d (patch) | |
| tree | 3b198eb54caa6b50986eefac622a1cbbafdcbd49 /src/uci.cpp | |
| parent | 9d2a95f566c5cb31d92af969d052b665ccbea9be (diff) | |
error hangling
Diffstat (limited to 'src/uci.cpp')
| -rw-r--r-- | src/uci.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/uci.cpp b/src/uci.cpp index 4357e99..f099b78 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -11,6 +11,7 @@ #include <cctype> #include <cstdint> #include <cstdio> +#include <cstdlib> #include <iostream> #include <sstream> #include <string> @@ -129,7 +130,10 @@ void Uci() { break; } } - + if (depth != -1 && depth <= 0) { + cout << "Fatal: Depth must be positive integer"; + exit(1); + } Move best = GetBestMove(&game, depth); cout << "bestmove "; |
