Rename MUEHLE_NMM to MADWEASEL_MUEHLE_RULE
This commit is contained in:
parent
545e78f176
commit
3c982c17f3
|
@ -65,7 +65,7 @@
|
||||||
//#define PERFECT_AI_SUPPORT
|
//#define PERFECT_AI_SUPPORT
|
||||||
#endif
|
#endif
|
||||||
#ifdef PERFECT_AI_SUPPORT
|
#ifdef PERFECT_AI_SUPPORT
|
||||||
#define MUEHLE_NMM
|
#define MADWEASEL_MUEHLE_RULE
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -85,7 +85,7 @@ ExtMove *generate<REMOVE>(Position &pos, ExtMove *moveList)
|
||||||
ExtMove *cur = moveList;
|
ExtMove *cur = moveList;
|
||||||
|
|
||||||
if (pos.is_all_in_mills(them)) {
|
if (pos.is_all_in_mills(them)) {
|
||||||
#ifndef MUEHLE_NMM
|
#ifndef MADWEASEL_MUEHLE_RULE
|
||||||
for (auto i = EFFECTIVE_SQUARE_NB - 1; i >= 0; i--) {
|
for (auto i = EFFECTIVE_SQUARE_NB - 1; i >= 0; i--) {
|
||||||
s = MoveList<LEGAL>::movePriorityList[i];
|
s = MoveList<LEGAL>::movePriorityList[i];
|
||||||
if (pos.get_board()[s] & make_piece(them)) {
|
if (pos.get_board()[s] & make_piece(them)) {
|
||||||
|
|
|
@ -644,7 +644,7 @@ bool Position::put_piece(Square s, bool updateRecord)
|
||||||
|
|
||||||
currentSquare = s;
|
currentSquare = s;
|
||||||
|
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
if (pieceInHandCount[WHITE] == 0 &&
|
if (pieceInHandCount[WHITE] == 0 &&
|
||||||
pieceInHandCount[BLACK] == 0 &&
|
pieceInHandCount[BLACK] == 0 &&
|
||||||
is_all_surrounded(~sideToMove, SQ_0, s)) {
|
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);
|
const int n = mills_count(currentSquare);
|
||||||
|
|
||||||
if (n == 0
|
if (n == 0
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
|| is_all_in_mills(them)
|
|| is_all_in_mills(them)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
|
@ -693,7 +693,7 @@ bool Position::put_piece(Square s, bool updateRecord)
|
||||||
|
|
||||||
} else if (phase == Phase::moving) {
|
} else if (phase == Phase::moving) {
|
||||||
|
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
if (is_all_surrounded(~sideToMove, currentSquare, s)) {
|
if (is_all_surrounded(~sideToMove, currentSquare, s)) {
|
||||||
set_gameover(sideToMove, GameOverReason::loseReasonNoWay);
|
set_gameover(sideToMove, GameOverReason::loseReasonNoWay);
|
||||||
}
|
}
|
||||||
|
@ -701,7 +701,7 @@ bool Position::put_piece(Square s, bool updateRecord)
|
||||||
if (check_if_game_is_over()) {
|
if (check_if_game_is_over()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // MUEHLE_NMM
|
#endif // MADWEASEL_MUEHLE_RULE
|
||||||
|
|
||||||
// If illegal
|
// If illegal
|
||||||
if (pieceOnBoardCount[sideToMove] > rule.flyPieceCount ||
|
if (pieceOnBoardCount[sideToMove] > rule.flyPieceCount ||
|
||||||
|
@ -743,7 +743,7 @@ bool Position::put_piece(Square s, bool updateRecord)
|
||||||
const int n = mills_count(currentSquare);
|
const int n = mills_count(currentSquare);
|
||||||
|
|
||||||
if (n == 0
|
if (n == 0
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
|| is_all_in_mills(them)
|
|| is_all_in_mills(them)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
|
@ -782,7 +782,7 @@ bool Position::remove_piece(Square s, bool updateRecord)
|
||||||
|
|
||||||
if (!rule.mayRemoveFromMillsAlways &&
|
if (!rule.mayRemoveFromMillsAlways &&
|
||||||
potential_mills_count(s, NOBODY)
|
potential_mills_count(s, NOBODY)
|
||||||
#ifndef MUEHLE_NMM
|
#ifndef MADWEASEL_MUEHLE_RULE
|
||||||
&& !is_all_in_mills(~sideToMove)
|
&& !is_all_in_mills(~sideToMove)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
|
@ -1263,9 +1263,9 @@ void Position::surrounded_pieces_count(Square s, int &ourPieceCount, int &theirP
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Position::is_all_surrounded(Color c
|
bool Position::is_all_surrounded(Color c
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
, Square from, Square to
|
, Square from, Square to
|
||||||
#endif // MUEHLE_NMM
|
#endif // MADWEASEL_MUEHLE_RULE
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// Full
|
// Full
|
||||||
|
@ -1280,10 +1280,10 @@ bool Position::is_all_surrounded(Color c
|
||||||
|
|
||||||
Bitboard bb = byTypeBB[ALL_PIECES];
|
Bitboard bb = byTypeBB[ALL_PIECES];
|
||||||
|
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
CLEAR_BIT(bb, from);
|
CLEAR_BIT(bb, from);
|
||||||
SET_BIT(bb, to);
|
SET_BIT(bb, to);
|
||||||
#endif // MUEHLE_NMM
|
#endif // MADWEASEL_MUEHLE_RULE
|
||||||
|
|
||||||
for (Square s = SQ_BEGIN; s < SQ_END; ++s) {
|
for (Square s = SQ_BEGIN; s < SQ_END; ++s) {
|
||||||
if ((c & color_on(s)) &&
|
if ((c & color_on(s)) &&
|
||||||
|
|
|
@ -133,9 +133,9 @@ public:
|
||||||
|
|
||||||
void surrounded_pieces_count(Square s, int &ourPieceCount, int &theirPieceCount, int &bannedCount, int &emptyCount);
|
void surrounded_pieces_count(Square s, int &ourPieceCount, int &theirPieceCount, int &bannedCount, int &emptyCount);
|
||||||
bool is_all_surrounded(Color c
|
bool is_all_surrounded(Color c
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
, Square from = SQ_0, Square to = SQ_0
|
, Square from = SQ_0, Square to = SQ_0
|
||||||
#endif // MUEHLE_NMM
|
#endif // MADWEASEL_MUEHLE_RULE
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
static void print_board();
|
static void print_board();
|
||||||
|
|
|
@ -1103,9 +1103,9 @@ bool Game::command(const string &cmd, bool update /* = true */)
|
||||||
gameStart();
|
gameStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
if (position.get_phase() != Phase::gameOver) {
|
if (position.get_phase() != Phase::gameOver) {
|
||||||
#endif // MUEHLE_NMM
|
#endif // MADWEASEL_MUEHLE_RULE
|
||||||
loggerDebug("Computer: %s\n\n", cmd.c_str());
|
loggerDebug("Computer: %s\n\n", cmd.c_str());
|
||||||
|
|
||||||
moveHistory.emplace_back(cmd);
|
moveHistory.emplace_back(cmd);
|
||||||
|
@ -1118,9 +1118,9 @@ bool Game::command(const string &cmd, bool update /* = true */)
|
||||||
|
|
||||||
if (!position.command(cmd.c_str()))
|
if (!position.command(cmd.c_str()))
|
||||||
return false;
|
return false;
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
}
|
}
|
||||||
#endif // MUEHLE_NMM
|
#endif // MADWEASEL_MUEHLE_RULE
|
||||||
|
|
||||||
sideToMove = position.side_to_move();
|
sideToMove = position.side_to_move();
|
||||||
|
|
||||||
|
@ -1662,7 +1662,7 @@ void Game::setTips()
|
||||||
case GameOverReason::loseReasonlessThanThree:
|
case GameOverReason::loseReasonlessThanThree:
|
||||||
break;
|
break;
|
||||||
case GameOverReason::loseReasonNoWay:
|
case GameOverReason::loseReasonNoWay:
|
||||||
#ifdef MUEHLE_NMM
|
#ifdef MADWEASEL_MUEHLE_RULE
|
||||||
if (!isInverted) {
|
if (!isInverted) {
|
||||||
turnStr = char_to_string(color_to_char(~p.sideToMove));
|
turnStr = char_to_string(color_to_char(~p.sideToMove));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue