diff --git a/src/bitboard.cpp b/src/bitboard.cpp index b4671f12f..3939296c3 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -64,7 +64,7 @@ namespace { // Some magics need to be split in order to reduce memory consumption. // Otherwise on a 12x10 board they can be >100 MB. #ifdef LARGEBOARDS - Bitboard RookTableH[0x11800]; // To store horizontalrook attacks + Bitboard RookTableH[0x11800]; // To store horizontal rook attacks Bitboard RookTableV[0x4800]; // To store vertical rook attacks Bitboard BishopTable[0x33C00]; // To store bishop attacks Bitboard CannonTableH[0x11800]; // To store horizontal cannon attacks @@ -220,7 +220,7 @@ std::string Bitboards::pretty(Bitboard b) { s += "| " + std::to_string(1 + r) + "\n+---+---+---+---+---+---+---+---+---+---+---+---+\n"; } - s += " a b c d e f g h i j k\n"; + s += " a b c d e f g h i j k l\n"; return s; } diff --git a/src/parser.cpp b/src/parser.cpp index 078c33873..f222a6bc1 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -106,8 +106,9 @@ namespace { target = value == "reversi" ? REVERSI : value == "ataxx" ? ATAXX : value == "quadwrangle" ? QUADWRANGLE + : value == "snort" ? SNORT : NO_ENCLOSING; - return value == "reversi" || value == "ataxx" || value == "quadwrangle" || value == "none"; + return value == "reversi" || value == "ataxx" || value == "quadwrangle" || value =="snort" || value == "none"; } template <> bool set(const std::string& value, Bitboard& target) { diff --git a/src/position.h b/src/position.h index 227913509..34b09763b 100644 --- a/src/position.h +++ b/src/position.h @@ -708,6 +708,12 @@ inline Bitboard Position::drop_region(Color c, PieceType pt) const { b ^= s; } } + else if (enclosing_drop() == SNORT) + { + Bitboard theirs = pieces(~c); + b &= ~(shift(theirs) | shift(theirs) + | shift(theirs) | shift(theirs)); + } else { assert(enclosing_drop() == ATAXX); diff --git a/src/types.h b/src/types.h index a59f86782..99c5e1aa3 100644 --- a/src/types.h +++ b/src/types.h @@ -302,7 +302,7 @@ enum ChasingRule { }; enum EnclosingRule { - NO_ENCLOSING, REVERSI, ATAXX, QUADWRANGLE + NO_ENCLOSING, REVERSI, ATAXX, QUADWRANGLE, SNORT }; enum OptBool { diff --git a/src/variants.ini b/src/variants.ini index 60ccfafe2..b5c035375 100644 --- a/src/variants.ini +++ b/src/variants.ini @@ -130,7 +130,7 @@ # [MaterialCounting]: material counting rules for adjudication [janggi, unweighted, whitedrawodds, blackdrawodds, none] # [CountingRule]: makruk, cambodian, or ASEAN counting rules [makruk, cambodian, asean, none] # [ChasingRule]: xiangqi chasing rules [axf, none] -# [EnclosingRule]: reversi or ataxx enclosing rules [reversi, ataxx, quadwrangle, none] +# [EnclosingRule]: reversi or ataxx enclosing rules [reversi, ataxx, quadwrangle, snort, none] ### Additional options relevant for usage in Winboard/XBoard # A few options only have the purpose of improving compatibility with Winboard/Xboard. @@ -1704,6 +1704,18 @@ flipEnclosedPieces = ataxx pieceDrops = false passOnStalemate = false +#https://www.ludii.games/details.php?keyword=Snort +#also known as Cats & Dogs +[snort:ataxx] +immobile = p +startFen = 8/8/8/8/8/8/8/8 +enclosingDrop = snort +flipEnclosedPieces = none +maxRank = 8 +maxFile = 8 +passOnStalemate = false +stalematePieceCount = false + #https://www.chess.com/variants/blackletter-chess [blackletter:chess] pieceToCharTable = PNBRQ.......E...M...HKpnbrq.......e...m...hk