Skip to content

Commit

Permalink
Change management repeating time controls to prevent time losses.
Browse files Browse the repository at this point in the history
Fixed an issue with the quit command.
  • Loading branch information
konsolas committed Jun 14, 2018
1 parent fb87373 commit 73f8b1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "eval.h"
#include "endgame.h"

#define TOPPLE_VER "0.0.3"
#define TOPPLE_VER "0.0.4"

const unsigned int MB = 1048576;

Expand Down Expand Up @@ -247,6 +247,7 @@ int main(int argc, char *argv[]) {
std::cout << *board << std::endl;
}
} else if (cmd == "quit") {
search_abort = true;
std::cout << "exiting" << std::endl;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions search.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace search_heur {
}

private:
move_t killers[MAX_PLY][2] = {0};
move_t killers[MAX_PLY][2] = {{EMPTY_MOVE}};
};
}

Expand All @@ -104,7 +104,7 @@ struct search_limits_t {
{
// Try and use a consistent amount of time per move
time_limit = (time /
(moves_to_go > 0 ? moves_to_go : std::max(60 - now, 40)));
(moves_to_go > 0 ? moves_to_go + 1: std::max(60 - now, 40)));

// Handle increment: Look to gain some time if there isn't much left
time_limit += inc / 2;
Expand Down

0 comments on commit 73f8b1a

Please sign in to comment.