aboutsummaryrefslogtreecommitdiff
path: root/src/repl.cpp
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-07-27 13:43:55 +0200
committerAdam <adammegarules1@gmail.com>2026-07-27 13:43:55 +0200
commit03437563f91a6f760fa8b0283e2e74586a9c7dac (patch)
treeed206ee691ca12e31ee0f8ab059d3274820cfe3c /src/repl.cpp
parent92cd6b4cd6321437bcbccb6b7f4396e60ff888b7 (diff)
implementing draw
Diffstat (limited to 'src/repl.cpp')
-rw-r--r--src/repl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/repl.cpp b/src/repl.cpp
index 76f921e..8eae719 100644
--- a/src/repl.cpp
+++ b/src/repl.cpp
@@ -34,6 +34,13 @@ int startREPL(Board *b) {
std::println();
return 0;
}
+ if (b->state == DRAW) {
+ printBoard(b);
+ std::println();
+ std::cout << "\033[1mDraw\033[0m" << "\n";
+ std::println();
+ return 0;
+ }
if (b->state == WHITE_WON) {
printBoard(b);
std::cout << "\033[1mChechmate White won\033[0m" << "\n";
@@ -45,7 +52,7 @@ int startREPL(Board *b) {
return 0;
}
if (b->state == TURN) {
- if (!b->turn) {
+ if (b->turn == false) {
auto moves = GetLegalMoves(b);
std::srand(
std::time(0)); // use current time as seed for random generator