Support Chancellor chess
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 4 May 2019 08:32:48 +0000 (10:32 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 4 May 2019 08:32:48 +0000 (10:32 +0200)
https://en.wikipedia.org/wiki/Chancellor_Chess

Readme.md
src/variant.cpp
tests/perft.sh

index a16b036..fbf41dd 100644 (file)
--- a/Readme.md
+++ b/Readme.md
@@ -15,7 +15,7 @@ Besides chess, the currently supported games are:
 - [Shogi](https://en.wikipedia.org/wiki/Shogi)
 
 **Chess variants**
-- [Capablanca](https://en.wikipedia.org/wiki/Capablanca_Chess), [Janus](https://en.wikipedia.org/wiki/Janus_Chess), [Modern](https://en.wikipedia.org/wiki/Modern_Chess_(chess_variant)), [Embassy](https://en.wikipedia.org/wiki/Embassy_Chess)
+- [Capablanca](https://en.wikipedia.org/wiki/Capablanca_Chess), [Janus](https://en.wikipedia.org/wiki/Janus_Chess), [Modern](https://en.wikipedia.org/wiki/Modern_Chess_(chess_variant)), [Chancellor](https://en.wikipedia.org/wiki/Chancellor_Chess), [Embassy](https://en.wikipedia.org/wiki/Embassy_Chess)
 - [Chess960](https://en.wikipedia.org/wiki/Chess960), [Placement/Pre-Chess](https://www.chessvariants.com/link/placement-chess)
 - [Crazyhouse](https://en.wikipedia.org/wiki/Crazyhouse), [Loop](https://en.wikipedia.org/wiki/Crazyhouse#Variations), [Chessgi](https://en.wikipedia.org/wiki/Crazyhouse#Variations), [Pocket Knight](http://www.chessvariants.com/other.dir/pocket.html)
 - [Amazon](https://en.wikipedia.org/wiki/Amazon_(chess)), [Chigorin](https://en.wikipedia.org/wiki/Chigorin_Chess), [Almost chess](https://en.wikipedia.org/wiki/Almost_Chess), [Hoppel-Poppel](http://www.chessvariants.com/diffmove.dir/hoppel-poppel.html)
index 1bc7754..af3f0ba 100644 (file)
@@ -523,6 +523,18 @@ VariantMap variants; // Global object
         v->promotionPieceTypes = {ARCHBISHOP, QUEEN, ROOK, BISHOP, KNIGHT};
         return v;
     }
+    Variant* chancellor_variant() {
+        Variant* v = fairy_variant_base();
+        v->maxRank = RANK_9;
+        v->maxFile = FILE_I;
+        v->promotionRank = RANK_9;
+        v->castlingKingsideFile = FILE_G;
+        v->castlingQueensideFile = FILE_C;
+        v->add_piece(CHANCELLOR, 'c');
+        v->startFen = "rnbqkcnbr/ppppppppp/9/9/9/9/9/PPPPPPPPP/RNBQKCNBR w KQkq - 0 1";
+        v->promotionPieceTypes = {CHANCELLOR, QUEEN, ROOK, BISHOP, KNIGHT};
+        return v;
+    }
     Variant* embassy_variant() {
         Variant* v = capablanca_variant();
         v->castlingKingsideFile = FILE_H;
@@ -625,6 +637,7 @@ void VariantMap::init() {
     add("capablanca", capablanca_variant());
     add("janus", janus_variant());
     add("modern", modern_variant());
+    add("chancellor", chancellor_variant());
     add("embassy", embassy_variant());
     add("jesonmor", jesonmor_variant());
     add("courier", courier_variant());
index 7c62ccc..c3f4bf1 100755 (executable)
@@ -63,6 +63,7 @@ if [[ $1 == "largeboard" ]]; then
   expect perft.exp embassy startpos 4 809539 > /dev/null
   expect perft.exp janus startpos 4 772074 > /dev/null
   expect perft.exp modern startpos 4 433729 > /dev/null
+  expect perft.exp chancellor startpos 4 436656 > /dev/null
   expect perft.exp courier startpos 4 500337 > /dev/null
 fi