movegen: 为九子棋定制候选着法排列顺序

This commit is contained in:
Calcitem 2019-10-26 01:08:54 +08:00
parent 31fa66f6da
commit 8dbc4c6ad7
2 changed files with 20 additions and 4 deletions

View File

@ -357,6 +357,15 @@ void MoveList::shuffle()
array<move_t, 4> movePriorityTable2 = { (move_t)16, (move_t)18, (move_t)20, (move_t)22 }; // 中圈十字架
array<move_t, 8> movePriorityTable3 = { (move_t)24, (move_t)26, (move_t)28, (move_t)30, (move_t)8, (move_t)10, (move_t)12, (move_t)14 }; // 外内圈十字架
if (rule.nTotalPiecesEachSide == 9)
{
movePriorityTable0 = { (move_t)16, (move_t)18, (move_t)20, (move_t)22 }; // 中圈十字架 (星位)
movePriorityTable1 = { (move_t)24, (move_t)26, (move_t)28, (move_t)30, (move_t)8, (move_t)10, (move_t)12, (move_t)14 }; // 外内圈十字架
movePriorityTable2 = { (move_t)17, (move_t)19, (move_t)21, (move_t)23 }; // 中圈四个顶点
movePriorityTable3 = { (move_t)25, (move_t)27, (move_t)29, (move_t)31, (move_t)9, (move_t)11, (move_t)13, (move_t)15 }; // 外圈和内圈四个顶点
}
if (options.getRandomMoveEnabled()) {
uint32_t seed = static_cast<uint32_t>(now());

View File

@ -510,10 +510,17 @@ bool Board::getCurrentPiece(player_t &player, int &number, square_t square)
bool Board::isStar(square_t square)
{
return (square == 17 ||
square == 19 ||
square == 21 ||
square == 23);
if (rule.nTotalPiecesEachSide == 12) {
return (square == 17 ||
square == 19 ||
square == 21 ||
square == 23);
}
return (square == 16 ||
square == 18 ||
square == 20 ||
square == 22);
}
void Board::mirror(list <string> &cmdlist, char* cmdline, int32_t move_, square_t square, bool cmdChange /*= true*/)