Change some judgement from rule.piecesCount to ule.hasDiagonalLines

This commit is contained in:
Calcitem 2021-05-01 20:09:07 +08:00
parent 8ac82e2214
commit 4ae863d24c
4 changed files with 9 additions and 9 deletions

View File

@ -378,12 +378,12 @@ void move_priority_list_shuffle()
std::array<Square, 4> movePriorityList2;
std::array<Square, 8> 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<LEGAL>::movePriorityList[i + 16] = movePriorityList3[i];
}
#if 0
if (rule.piecesCount == 9 && gameOptions.getShufflingEnabled()) {
if (!rule.hasDiagonalLines && gameOptions.getShufflingEnabled()) {
const uint32_t seed = static_cast<uint32_t>(now());
std::shuffle(MoveList<LEGAL>::movePriorityList.begin(), MoveList<LEGAL>::movePriorityList.end(), std::default_random_engine(seed));
}

View File

@ -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<ON_BOARD>(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<ON_BOARD>(WHITE) < 2 && // patch: only when white 2nd move
Position::is_star_square(static_cast<Square>(m))) {
cur->value += RATING_STAR_SQUARE;
}

View File

@ -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"

View File

@ -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<uint32_t>(now());
std::shuffle(MoveList<LEGAL>::movePriorityList.begin(), MoveList<LEGAL>::movePriorityList.end(), std::default_random_engine(seed));
}