stellarUCI Chess engine written in C++20 |
git clone git://git.dimitrijedobrota.com/stellar.git |
Log | Files | Refs | README | LICENSE | |
commit | 63d7568e62922c5488d19978f5236e10117e3b28 |
parent | ac15a56b21d7e7a0b3994dd62b8c47605400c947 |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Thu, 21 Sep 2023 18:15:41 +0000 |
Fix CMakeLists.txt, add help to perft
Diffstat:M | CMakeLists.txt | | | ++-- |
M | src/perft/perft.cpp | | | +++++++++++++- |
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -4,9 +4,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(
Stellar
VERSION 0.0.35
DESCRIPTION "Chess engine written in C"
DESCRIPTION "Chess engine written in C++"
HOMEPAGE_URL https://git.dimitrijedobrota.com/stellar.git
LANGUAGES C CXX
LANGUAGES CXX
)
enable_testing()
diff --git a/src/perft/perft.cpp b/src/perft/perft.cpp
@@ -121,11 +121,19 @@ void perft_test(const char *fen, int depth, int thread_num) {
#endif
}
void usage(const char *program) {
std::cout << "Usage: " << program;
std::cout << " [-h]";
std::cout << " [-t thread number]";
std::cout << " [-d depth]";
std::cout << " [-f fen]" <<std::endl;
}
int main(int argc, char *argv[]) {
int c, depth = 1, thread_num = 1;
std::string s(start_position);
const char *fen = s.data();
while ((c = getopt(argc, argv, "t:f:d:")) != -1) {
while ((c = getopt(argc, argv, "ht:f:d:")) != -1) {
switch (c) {
case 't':
thread_num = atoi(optarg);
@@ -138,7 +146,11 @@ int main(int argc, char *argv[]) {
depth = atoi(optarg);
if (depth <= 0) abort();
break;
case 'h':
usage(argv[0]);
return 1;
default:
usage(argv[0]);
abort();
}
}