perfect: Add MUEHLE_NMM macron (WAR)

This commit is contained in:
Calcitem 2021-01-24 23:03:15 +08:00
parent 84d8e37f3c
commit fa0cb740f6
3 changed files with 21 additions and 4 deletions

View File

@ -55,6 +55,10 @@
#ifndef DISABLE_PERFECT_AI
#ifdef _MSC_VER
#define PERFECT_AI_SUPPORT
#ifdef PERFECT_AI_SUPPORT
#define MUEHLE_NMM
#endif
#endif
#endif

View File

@ -94,12 +94,14 @@ ExtMove *generate<REMOVE>(Position &pos, ExtMove *moveList)
ExtMove *cur = moveList;
if (pos.is_all_in_mills(them)) {
#ifndef MUEHLE_NMM
for (auto i = EFFECTIVE_SQUARE_NB - 1; i >= 0; i--) {
s = MoveList<LEGAL>::movePriorityList[i];
if (pos.get_board()[s] & make_piece(them)) {
*cur++ = (Move)-s;
}
}
#endif
return cur;
}

View File

@ -652,7 +652,11 @@ bool Position::put_piece(Square s, bool updateRecord)
const int n = mills_count(currentSquare);
if (n == 0) {
if (n == 0
#ifdef MUEHLE_NMM
|| is_all_in_mills(them)
#endif
) {
assert(pieceInHandCount[BLACK] >= 0 && pieceInHandCount[WHITE] >= 0);
if (pieceInHandCount[BLACK] == 0 && pieceInHandCount[WHITE] == 0) {
@ -723,7 +727,11 @@ bool Position::put_piece(Square s, bool updateRecord)
currentSquare = s;
const int n = mills_count(currentSquare);
if (n == 0) {
if (n == 0
#ifdef MUEHLE_NMM
|| is_all_in_mills(them)
#endif
) {
action = Action::select;
change_side_to_move();
@ -758,8 +766,11 @@ bool Position::remove_piece(Square s, bool updateRecord)
return false;
if (!rule.mayRemoveFromMillsAlways &&
potential_mills_count(s, NOBODY) &&
!is_all_in_mills(~sideToMove)) {
potential_mills_count(s, NOBODY)
#ifndef MUEHLE_NMM
&& !is_all_in_mills(~sideToMove)
#endif
) {
return false;
}