template <> bool set(const std::string& value, EnclosingRule& target) {
target = value == "reversi" ? REVERSI
: value == "ataxx" ? ATAXX
+ : value == "quadwrangle" ? QUADWRANGLE
: NO_ENCLOSING;
- return value == "reversi" || value == "ataxx" || value == "none";
+ return value == "reversi" || value == "ataxx" || value == "quadwrangle" || value == "none";
}
template <> bool set(const std::string& value, Bitboard& target) {
}
else
{
- assert(flip_enclosed_pieces() == ATAXX);
- st->flippedPieces = PseudoAttacks[us][KING][to] & pieces(~us);
+ assert((flip_enclosed_pieces() == ATAXX) || (flip_enclosed_pieces() == QUADWRANGLE));
+ if ((flip_enclosed_pieces() == ATAXX) || (flip_enclosed_pieces() == QUADWRANGLE && (PseudoAttacks[us][KING][to] & pieces(us) || type_of(m) == NORMAL)))
+ {
+ st->flippedPieces = PseudoAttacks[us][KING][to] & pieces(~us);
+ }
}
// Flip pieces
};
enum EnclosingRule {
- NO_ENCLOSING, REVERSI, ATAXX
+ NO_ENCLOSING, REVERSI, ATAXX, QUADWRANGLE
};
enum OptBool {
# [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, none]
+# [EnclosingRule]: reversi or ataxx enclosing rules [reversi, ataxx, quadwrangle, none]
### Additional options relevant for usage in Winboard/XBoard
# A few options only have the purpose of improving compatibility with Winboard/Xboard.
pawnTypes = p
petrifyOnCapture = true
enPassantRegion = -
+
+#https://www.ludii.games/details.php?keyword=Quad%20Wrangle
+[quadwrangle:ataxx]
+#different sources give different info on whether it is a 7x7 or 8x8 board.
+#could offer both if wanted.
+maxRank = 8
+maxFile = 8
+startFen = 1PPPPPP1/p6P/p6P/p6P/p6P/p6P/p6P/1pppppp1
+customPiece1 = p:mQ
+flipEnclosedPieces = quadwrangle
+#override rule from ataxx since drops can be done freely
+enclosingDrop = none
+
+[quadwrangle7x7:quadwrangle]
+maxRank = 7
+maxFile = 7
+startFen = 1PPPPP1/p5P/p5P/p5P/p5P/p5P/1ppppp1