// Connect-n
if (pos.connect_n() > 0)
{
- for (Direction d : {NORTH, NORTH_EAST, EAST, SOUTH_EAST})
+ std::vector<Direction> connect_directions;
+
+ if (pos.connect_horizontal())
+ {
+ connect_directions.push_back(EAST);
+ }
+ if (pos.connect_vertical())
+ {
+ connect_directions.push_back(NORTH);
+ }
+ if (pos.connect_diagonal())
+ {
+ connect_directions.push_back(NORTH_EAST);
+ connect_directions.push_back(SOUTH_EAST);
+ }
+ for (Direction d : connect_directions)
{
// Find sufficiently large gaps
Bitboard b = pos.board_bb() & ~pos.pieces(Them);
parse_attribute("flagMove", v->flagMove);
parse_attribute("checkCounting", v->checkCounting);
parse_attribute("connectN", v->connectN);
+ parse_attribute("connectHorizontal", v->connectHorizontal);
+ parse_attribute("connectVertical", v->connectVertical);
+ parse_attribute("connectDiagonal", v->connectDiagonal);
parse_attribute("materialCounting", v->materialCounting);
parse_attribute("countingRule", v->countingRule);
if (connect_n() > 0)
{
Bitboard b;
- for (Direction d : {NORTH, NORTH_EAST, EAST, SOUTH_EAST})
+ std::vector<Direction> connect_directions;
+
+ if (connect_horizontal())
+ {
+ connect_directions.push_back(EAST);
+ }
+ if (connect_vertical())
+ {
+ connect_directions.push_back(NORTH);
+ }
+ if (connect_diagonal())
+ {
+ connect_directions.push_back(NORTH_EAST);
+ connect_directions.push_back(SOUTH_EAST);
+ }
+ for (Direction d : connect_directions)
{
b = pieces(~sideToMove);
for (int i = 1; i < connect_n() && b; i++)
bool flag_reached(Color c) const;
bool check_counting() const;
int connect_n() const;
+ bool connect_horizontal() const;
+ bool connect_vertical() const;
+ bool connect_diagonal() const;
+
CheckCount checks_remaining(Color c) const;
MaterialCounting material_counting() const;
CountingRule counting_rule() const;
return var->connectN;
}
+inline bool Position::connect_horizontal() const {
+ assert(var != nullptr);
+ return var->connectHorizontal;
+}
+inline bool Position::connect_vertical() const {
+ assert(var != nullptr);
+ return var->connectVertical;
+}
+inline bool Position::connect_diagonal() const {
+ assert(var != nullptr);
+ return var->connectDiagonal;
+}
+
+
inline CheckCount Position::checks_remaining(Color c) const {
return st->checksRemaining[c];
}
// Possible states after a probing operation
enum ProbeState {
FAIL = 0, // Probe failed (missing file table)
- OK = 1, // Probe succesful
+ OK = 1, // Probe successful
CHANGE_STM = -1, // DTZ should check the other side
ZEROING_BEST_MOVE = 2 // Best move zeroes DTZ (capture or pawn move)
};
bool flagMove = false;
bool checkCounting = false;
int connectN = 0;
+ bool connectHorizontal = true;
+ bool connectVertical = true;
+ bool connectDiagonal = true;
MaterialCounting materialCounting = NO_MATERIAL_COUNTING;
CountingRule countingRule = NO_COUNTING;
# flagMove: the other side gets one more move after one reaches the flag zone [bool] (default: false)
# checkCounting: enable check count win rule (check count is communicated via FEN, see 3check) [bool] (default: false)
# connectN: number of aligned pieces for win [int] (default: 0)
+# connectVertical: connectN looks at Vertical rows [bool] (default: true)
+# connectHorizontal: connectN looks at Horizontal rows [bool] (default: true)
+# connectDiagonal: connectN looks at Diagonal rows [bool] (default: true)
# materialCounting: enable material counting rules [MaterialCounting] (default: none)
# countingRule: enable counting rules [CountingRule] (default: none)
flagRegionBlack = a1 b1 c1 d1 e1 a2 e2
flagPieceCount = 7
flagPieceBlockedWin = true
+nFoldRule = 0
+nMoveRule = 0
#https://www.chessvariants.com/large.dir/xhess.html
[xhess:chess]
[tuktuk]
maxRank = 6
maxFile = f
-customPiece1 = w:mfbR
+customPiece1 = w:mvR
startFen = wwwwww/6/6/6/6/WWWWWW w
stalemateValue = loss
nFoldRule=0
customPiece1 = w:mW
startFen = wWwWw/WwWwW/wW1Ww/WwWwW/wWwWw w
stalemateValue = loss
+nMoveRule = 0
+
+[picaria:tictactoe]
+#Known under multiple names but using the name from Wikipedia.
+#https://ludii.games/details.php?keyword=Picaria https://en.wikipedia.org/wiki/Picaria
+#https://ludii.games/details.php?keyword=Les%20Pendus
+#https://ludii.games/details.php?keyword=Wure%20Dune
+#https://ludii.games/details.php?keyword=Djara-Badakh
+#https://ludii.games/details.php?keyword=Tuk%20Tak
+customPiece1 = p:mKmNmAmD
+#moves anywhere on the board, KNAD is an list of all possible moves on a 3x3
+startFen = 3/3/3[PPPppp] w - - 0 1
+mustDrop = true
+nMoveRule = 0
+nFoldRule = 0
+
+[nineholes:picaria]
+#https://ludii.games/details.php?keyword=Nine%20Holes https://en.wikipedia.org/wiki/Nine_Holes
+#https://ludii.games/details.php?keyword=San-Noku-Narabe
+#https://ludii.games/details.php?keyword=Driesticken
+#https://ludii.games/details.php?keyword=Akidada
+#https://ludii.games/details.php?keyword=Dris%20at-Talata
+connectDiagonal = false
+
+[asimplegame]
+#https://ludii.games/details.php?keyword=A%20Simple%20Game
+maxRank = 4
+maxFile = d
+customPiece1 = p:mW
+connectN = 3
+startFen = pPpP/4/4/PpPp w - - 0 1
+nMoveRule = 0
+#according to Jan's own Zillions file, any repetition is a draw
+nFoldRule = 2
+
+[alapo:chess]
+#https://www.chessvariants.org/small.dir/alapo.html
+#Reaching the opponent's back row such that the piece isn't immediately
+#captured is a win. Let's promote to a victory piece (Amazon), then, moving
+#that piece to anywhere not on the back row is a victory. There's nothing about
+#the Amazon in the rules, just a powerful piece.
+pieceToCharTable = ..BRQ........AFW.....K..brq........afw.....k
+maxRank = 6
+maxFile = f
+wazir = w
+fers = f
+amazon = a
+king = -
+commoner = k
+startFen = rbqqbr/wfkkfw/6/6/WFKKFW/RBQQBR
+promotionRegionWhite = *6
+promotionRegionBlack = *1
+promotedPieceType = w:a r:a f:a b:a k:a q:a
+mandatoryPiecePromotion = true
+flagPiece = a
+flagRegionWhite = *5 *4 *3 *2 *1
+flagRegionBlack = *6 *5 *4 *3 *2
+stalemateValue = loss
+nMoveRule = 0
+nFoldRule = 0
+
+[rooksquare:chess]
+#https://www.chessvariants.com/diffobjective.dir/rooksquare.html
+flagRegionWhite = a8 h8
+flagRegionBlack = a1 h1
+
+[allqueenschess]
+#https://boardgamegeek.com/boardgame/34948/all-queens-chess
+maxRank = 5
+maxFile = e
+startFen = qQqQq/5/Q3q/5/QqQqQ
+customPiece1 = q:mQ
+connectN = 4
+nMoveRule = 0
+nFoldRule = 0