rule50: Judge rule50 and draw (WIP)
This commit is contained in:
parent
e02c744a7b
commit
285cee07ef
|
@ -935,7 +935,7 @@ bool Position::check_if_game_is_over()
|
|||
}
|
||||
|
||||
if (rule.maxStepsLedToDraw > 0 &&
|
||||
rule50_count() > rule.maxStepsLedToDraw) {
|
||||
posKeyHistory.size() > rule.maxStepsLedToDraw) {
|
||||
winner = DRAW;
|
||||
phase = Phase::gameOver;
|
||||
gameOverReason = GameOverReason::drawReasonRule50;
|
||||
|
|
|
@ -93,6 +93,9 @@ int Thread::search()
|
|||
#endif
|
||||
|
||||
if (rootPos->get_phase() == Phase::moving) {
|
||||
if (posKeyHistory.size() > rule.maxStepsLedToDraw) {
|
||||
return 99;
|
||||
}
|
||||
#ifdef THREEFOLD_REPETITION
|
||||
if (rootPos->has_game_cycle()) {
|
||||
return 3;
|
||||
|
|
|
@ -143,7 +143,9 @@ void Thread::idle_loop()
|
|||
emitCommand();
|
||||
} else {
|
||||
#endif
|
||||
if (search() == 3) {
|
||||
int ret = search();
|
||||
|
||||
if (ret == 3 || ret == 50) {
|
||||
loggerDebug("Draw\n\n");
|
||||
strCommand = "draw";
|
||||
emitCommand();
|
||||
|
|
Loading…
Reference in New Issue