diff --git a/include/config.h b/include/config.h index 8fe23a56..0d433978 100644 --- a/include/config.h +++ b/include/config.h @@ -65,7 +65,7 @@ //#define PERFECT_AI_SUPPORT #endif #ifdef PERFECT_AI_SUPPORT -#define MUEHLE_NMM +#define MADWEASEL_MUEHLE_RULE #endif #endif #endif diff --git a/src/movegen.cpp b/src/movegen.cpp index 40c7281d..21ab1eb1 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -85,7 +85,7 @@ ExtMove *generate(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::movePriorityList[i]; if (pos.get_board()[s] & make_piece(them)) { diff --git a/src/position.cpp b/src/position.cpp index 96c8b86f..79b401ee 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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)) && diff --git a/src/position.h b/src/position.h index eeff374a..1d6e8d73 100644 --- a/src/position.h +++ b/src/position.h @@ -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(); diff --git a/src/ui/qt/game.cpp b/src/ui/qt/game.cpp index 6f6b35df..aef8463d 100644 --- a/src/ui/qt/game.cpp +++ b/src/ui/qt/game.cpp @@ -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 {