Support Jeson Mor
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 6 Oct 2018 16:43:11 +0000 (18:43 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 7 Oct 2018 14:40:23 +0000 (16:40 +0200)
https://en.wikipedia.org/wiki/Jeson_Mor

Positions are considered to be winning if a player has the move
and one of his knights is on e5.

No functional change for other variants.

src/variant.cpp

index 227868f..e56f626 100644 (file)
@@ -500,6 +500,23 @@ void VariantMap::init() {
         v->promotionPieceTypes = {ARCHBISHOP, CHANCELLOR, QUEEN, ROOK, BISHOP, KNIGHT};
         return v;
     } ();
+    const Variant* jesonmor = [&]{
+        Variant* v = new Variant();
+        v->maxRank = RANK_9;
+        v->maxFile = FILE_I;
+        v->reset_pieces();
+        v->add_piece(KNIGHT, 'n');
+        v->startFen = "nnnnnnnnn/9/9/9/9/9/9/9/NNNNNNNNN w - - 0 1";
+        v->promotionPieceTypes = {};
+        v->doubleStep = false;
+        v->castling = false;
+        v->stalemateValue = -VALUE_MATE;
+        v->flagPiece = KNIGHT;
+        v->whiteFlag = make_bitboard(SQ_E5);
+        v->blackFlag = make_bitboard(SQ_E5);
+        v->flagMove = true;
+        return v;
+    } ();
 #endif
 
     // Add to UCI_Variant option
@@ -542,6 +559,7 @@ void VariantMap::init() {
     add("capablanca", capablanca);
     add("janus", janus);
     add("embassy", embassy);
+    add("jesonmor", jesonmor);
 #endif
 }