diff --git a/src/mills.cpp b/src/mills.cpp index ba52f360..add3418e 100644 --- a/src/mills.cpp +++ b/src/mills.cpp @@ -378,12 +378,12 @@ void move_priority_list_shuffle() std::array movePriorityList2; std::array movePriorityList3; - if (rule.piecesCount == 9) { + if (!rule.hasDiagonalLines) { movePriorityList0 = { SQ_16, SQ_18, SQ_20, SQ_22 }; movePriorityList1 = { SQ_24, SQ_26, SQ_28, SQ_30, SQ_8, SQ_10, SQ_12, SQ_14 }; movePriorityList2 = { SQ_17, SQ_19, SQ_21, SQ_23 }; movePriorityList3 = { SQ_25, SQ_27, SQ_29, SQ_31, SQ_9, SQ_11, SQ_13, SQ_15 }; - } else if (rule.piecesCount == 12) { + } else if (rule.hasDiagonalLines) { movePriorityList0 = { SQ_17, SQ_19, SQ_21, SQ_23 }; movePriorityList1 = { SQ_25, SQ_27, SQ_29, SQ_31, SQ_9, SQ_11, SQ_13, SQ_15 }; movePriorityList2 = { SQ_16, SQ_18, SQ_20, SQ_22 }; @@ -415,7 +415,7 @@ void move_priority_list_shuffle() MoveList::movePriorityList[i + 16] = movePriorityList3[i]; } #if 0 - if (rule.piecesCount == 9 && gameOptions.getShufflingEnabled()) { + if (!rule.hasDiagonalLines && gameOptions.getShufflingEnabled()) { const uint32_t seed = static_cast(now()); std::shuffle(MoveList::movePriorityList.begin(), MoveList::movePriorityList.end(), std::default_random_engine(seed)); } diff --git a/src/movepick.cpp b/src/movepick.cpp index be188c5c..b1284062 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -94,7 +94,7 @@ void MovePicker::score() if (to % 2 == 0 && theirPiecesCount == 3) { cur->value += RATING_BLOCK_ONE_MILL * theirMillsCount; - } else if (to % 2 == 1 && theirPiecesCount == 2 && rule.piecesCount == 12) { + } else if (to % 2 == 1 && theirPiecesCount == 2 && rule.hasDiagonalLines) { cur->value += RATING_BLOCK_ONE_MILL * theirMillsCount; } } @@ -103,9 +103,9 @@ void MovePicker::score() //cur->value += bannedCount; // placing phrase, place nearby ban point - // for 12 men, white 's 2nd move place star point is as important as close mill (TODO) - if (rule.piecesCount == 12 && - pos.count(WHITE) < 2 && // patch: only when white's 2nd move + // for 12 men's morris (has diagonal), white 2nd move place star point is as important as close mill (TODO) + if (rule.hasDiagonalLines && + pos.count(WHITE) < 2 && // patch: only when white 2nd move Position::is_star_square(static_cast(m))) { cur->value += RATING_STAR_SQUARE; } diff --git a/src/position.cpp b/src/position.cpp index 9ae7f52e..8df68514 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1309,7 +1309,7 @@ bool Position::is_star_square(Square s) void Position::print_board() { - if (rule.piecesCount == 12) { + if (rule.hasDiagonalLines) { printf("\n" "31 ----- 24 ----- 25\n" "| \\ | / |\n" diff --git a/src/search.cpp b/src/search.cpp index 551f0615..bba1ed85 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -140,7 +140,7 @@ int Thread::search() #if 0 // TODO: Only NMM if (rootPos->piece_on_board_count(BLACK) + rootPos->piece_on_board_count(WHITE) <= 1 && - rule.piecesCount == 9 && gameOptions.getShufflingEnabled()) { + !rule.hasDiagonalLines && gameOptions.getShufflingEnabled()) { const uint32_t seed = static_cast(now()); std::shuffle(MoveList::movePriorityList.begin(), MoveList::movePriorityList.end(), std::default_random_engine(seed)); }