From aef3511d2b5dd6ebecfadcdf3f1f1352ec3c3d07 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sat, 4 May 2019 10:32:48 +0200 Subject: [PATCH] Support Chancellor chess https://en.wikipedia.org/wiki/Chancellor_Chess --- Readme.md | 2 +- src/variant.cpp | 13 +++++++++++++ tests/perft.sh | 1 + 3 files changed, 15 insertions(+), 1 deletions(-) diff --git a/Readme.md b/Readme.md index a16b036..fbf41dd 100644 --- 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) diff --git a/src/variant.cpp b/src/variant.cpp index 1bc7754..af3f0ba 100644 --- a/src/variant.cpp +++ b/src/variant.cpp @@ -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()); diff --git a/tests/perft.sh b/tests/perft.sh index 7c62ccc..c3f4bf1 100755 --- a/tests/perft.sh +++ b/tests/perft.sh @@ -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 -- 1.7.0.4