Rename MUEHLE_NMM to MADWEASEL_MUEHLE_RULE

This commit is contained in:
Calcitem 2021-07-31 12:58:25 +08:00
parent 545e78f176
commit 3c982c17f3
No known key found for this signature in database
GPG Key ID: F2F7C29E054CFB80
5 changed files with 19 additions and 19 deletions

View File

@ -65,7 +65,7 @@
//#define PERFECT_AI_SUPPORT
#endif
#ifdef PERFECT_AI_SUPPORT
#define MUEHLE_NMM
#define MADWEASEL_MUEHLE_RULE
#endif
#endif
#endif

View File

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

View File

@ -644,7 +644,7 @@ bool Position::put_piece(Square s, bool updateRecord)
currentSquare = s;
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
if (pieceInHandCount[WHITE] == 0 &&
pieceInHandCount[BLACK] == 0 &&
is_all_surrounded(~sideToMove, SQ_0, s)) {
@ -657,7 +657,7 @@ bool Position::put_piece(Square s, bool updateRecord)
const int n = mills_count(currentSquare);
if (n == 0
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
|| is_all_in_mills(them)
#endif
) {
@ -693,7 +693,7 @@ bool Position::put_piece(Square s, bool updateRecord)
} else if (phase == Phase::moving) {
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
if (is_all_surrounded(~sideToMove, currentSquare, s)) {
set_gameover(sideToMove, GameOverReason::loseReasonNoWay);
}
@ -701,7 +701,7 @@ bool Position::put_piece(Square s, bool updateRecord)
if (check_if_game_is_over()) {
return true;
}
#endif // MUEHLE_NMM
#endif // MADWEASEL_MUEHLE_RULE
// If illegal
if (pieceOnBoardCount[sideToMove] > rule.flyPieceCount ||
@ -743,7 +743,7 @@ bool Position::put_piece(Square s, bool updateRecord)
const int n = mills_count(currentSquare);
if (n == 0
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
|| is_all_in_mills(them)
#endif
) {
@ -782,7 +782,7 @@ bool Position::remove_piece(Square s, bool updateRecord)
if (!rule.mayRemoveFromMillsAlways &&
potential_mills_count(s, NOBODY)
#ifndef MUEHLE_NMM
#ifndef MADWEASEL_MUEHLE_RULE
&& !is_all_in_mills(~sideToMove)
#endif
) {
@ -1263,9 +1263,9 @@ void Position::surrounded_pieces_count(Square s, int &ourPieceCount, int &theirP
}
bool Position::is_all_surrounded(Color c
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
, Square from, Square to
#endif // MUEHLE_NMM
#endif // MADWEASEL_MUEHLE_RULE
) const
{
// Full
@ -1280,10 +1280,10 @@ bool Position::is_all_surrounded(Color c
Bitboard bb = byTypeBB[ALL_PIECES];
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
CLEAR_BIT(bb, from);
SET_BIT(bb, to);
#endif // MUEHLE_NMM
#endif // MADWEASEL_MUEHLE_RULE
for (Square s = SQ_BEGIN; s < SQ_END; ++s) {
if ((c & color_on(s)) &&

View File

@ -133,9 +133,9 @@ public:
void surrounded_pieces_count(Square s, int &ourPieceCount, int &theirPieceCount, int &bannedCount, int &emptyCount);
bool is_all_surrounded(Color c
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
, Square from = SQ_0, Square to = SQ_0
#endif // MUEHLE_NMM
#endif // MADWEASEL_MUEHLE_RULE
) const;
static void print_board();

View File

@ -1103,9 +1103,9 @@ bool Game::command(const string &cmd, bool update /* = true */)
gameStart();
}
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
if (position.get_phase() != Phase::gameOver) {
#endif // MUEHLE_NMM
#endif // MADWEASEL_MUEHLE_RULE
loggerDebug("Computer: %s\n\n", cmd.c_str());
moveHistory.emplace_back(cmd);
@ -1118,9 +1118,9 @@ bool Game::command(const string &cmd, bool update /* = true */)
if (!position.command(cmd.c_str()))
return false;
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
}
#endif // MUEHLE_NMM
#endif // MADWEASEL_MUEHLE_RULE
sideToMove = position.side_to_move();
@ -1662,7 +1662,7 @@ void Game::setTips()
case GameOverReason::loseReasonlessThanThree:
break;
case GameOverReason::loseReasonNoWay:
#ifdef MUEHLE_NMM
#ifdef MADWEASEL_MUEHLE_RULE
if (!isInverted) {
turnStr = char_to_string(color_to_char(~p.sideToMove));
} else {