Skip to content

Commit

Permalink
Another uci fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rafid-dev committed Mar 31, 2023
1 parent 7972fca commit 58b4720
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ using namespace Chess;
#define INF_BOUND 30000
#define ISMATE 29000

#define IS_DEBUG false
#define IS_DEBUG true

static inline bool is_capture(Board& board, Move move){
return (board.pieceAtB(to(move)) != None);
Expand Down
19 changes: 15 additions & 4 deletions src/uci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,19 @@ void uci_loop()
}

// Time
if (token == "wtime" || token == "btime")
if (token == "wtime")
{
is >> std::skipws >> token;
if (board.sideToMove == White)
{
uciTime = stoi(token);
}
else if (board.sideToMove == Black)
is >> std::skipws >> token;
continue;
}
if (token == "btime"){
is >> std::skipws >> token;
if (board.sideToMove == Black)
{
uciTime = stoi(token);
}
Expand All @@ -196,14 +201,20 @@ void uci_loop()
}

// Increment
if (token == "winc" || token == "binc")
if (token == "winc")
{
is >> std::skipws >> token;
if (board.sideToMove == White)
{
inc = stoi(token);
}
else if (board.sideToMove == Black)
is >> std::skipws >> token;
continue;
}
if (token == "binc")
{
is >> std::skipws >> token;
if (board.sideToMove == Black)
{
inc = stoi(token);
}
Expand Down

0 comments on commit 58b4720

Please sign in to comment.