From: ianfab Date: Sat, 7 Jul 2018 15:22:35 +0000 (+0200) Subject: Support shatar (incomplete), chigorin, and almost chess X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=e65b745841125255bba955dbf9a64d886b71b6a4;p=fairystockfish.git Support shatar (incomplete), chigorin, and almost chess bench: 4636838 --- diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 4dbb34a..f43eb82 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -157,6 +157,8 @@ void Bitboards::init() { { -18, -14, 14, 18 }, // alfil { -9, -7, 7, 8, 9 }, // silver/khon { -17, -15, -10, -9, -7, -6, 6, 7, 9, 10, 15, 17 }, // aiwok + { -9, -7, 7, 9 }, // bers/dragon + { -17, -15, -10, -6, 6, 10, 15, 17 }, // chancellor { -17, -15, -10, -6, 6, 10, 15, 17 }, // amazon {}, // knibis { -17, -15, -10, -6, 6, 10, 15, 17 }, // biskni @@ -178,6 +180,8 @@ void Bitboards::init() { { -18, -14, 14, 18 }, // alfil { -9, -7, 7, 8, 9 }, // silver/khon { -17, -15, -10, -9, -7, -6, 6, 7, 9, 10, 15, 17 }, // aiwok + { -9, -7, 7, 9 }, // bers/dragon + { -17, -15, -10, -6, 6, 10, 15, 17 }, // chancellor { -17, -15, -10, -6, 6, 10, 15, 17 }, // amazon { -17, -15, -10, -6, 6, 10, 15, 17 }, // knibis {}, // biskni @@ -199,6 +203,8 @@ void Bitboards::init() { {}, // alfil {}, // silver/khon { NORTH, EAST, SOUTH, WEST }, // aiwok + { NORTH, EAST, SOUTH, WEST }, // bers/dragon + { NORTH, EAST, SOUTH, WEST }, // chancellor { NORTH, EAST, SOUTH, WEST, NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST }, // amazon { NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST }, // knibis {}, // biskni @@ -220,6 +226,8 @@ void Bitboards::init() { {}, // alfil {}, // silver/khon { NORTH, EAST, SOUTH, WEST }, // aiwok + { NORTH, EAST, SOUTH, WEST }, // bers/dragon + { NORTH, EAST, SOUTH, WEST }, // chancellor { NORTH, EAST, SOUTH, WEST, NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST }, // amazon {}, // knibis { NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST }, // biskni @@ -241,6 +249,8 @@ void Bitboards::init() { 0, // alfil 0, // silver/khon 7, // aiwok + 7, // bers/dragon + 7, // chancellor 7, // amazon 7, // knibis 0, // biskni @@ -262,6 +272,8 @@ void Bitboards::init() { 0, // alfil 0, // silver/khon 7, // aiwok + 7, // bers/dragon + 7, // chancellor 7, // amazon 0, // knibis 7, // biskni diff --git a/src/psqt.cpp b/src/psqt.cpp index a743157..a6a9cf7 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -24,10 +24,12 @@ Value PieceValue[PHASE_NB][PIECE_NB] = { { VALUE_ZERO, PawnValueMg, KnightValueMg, BishopValueMg, RookValueMg, QueenValueMg, - FersValueMg, AlfilValueMg, SilverValueMg, AiwokValueMg, AmazonValueMg, KnibisValueMg, BiskniValueMg, + FersValueMg, AlfilValueMg, SilverValueMg, AiwokValueMg, BersValueMg, ChancellorValueMg, + AmazonValueMg, KnibisValueMg, BiskniValueMg, ShogiPawnValueMg, LanceValueMg, ShogiKnightValueMg, EuroShogiKnightValueMg, GoldValueMg }, { VALUE_ZERO, PawnValueEg, KnightValueEg, BishopValueEg, RookValueEg, QueenValueEg, - FersValueEg, AlfilValueEg, SilverValueEg, AiwokValueEg, AmazonValueEg, KnibisValueMg, BiskniValueMg, + FersValueEg, AlfilValueEg, SilverValueEg, AiwokValueEg, BersValueEg, ChancellorValueEg, + AmazonValueEg, KnibisValueMg, BiskniValueMg, ShogiPawnValueEg, LanceValueEg, ShogiKnightValueEg, EuroShogiKnightValueEg, GoldValueEg } }; diff --git a/src/types.h b/src/types.h index df9f41c..94ff7a4 100644 --- a/src/types.h +++ b/src/types.h @@ -190,23 +190,25 @@ enum Value : int { VALUE_MATE_IN_MAX_PLY = VALUE_MATE - 2 * MAX_PLY, VALUE_MATED_IN_MAX_PLY = -VALUE_MATE + 2 * MAX_PLY, - PawnValueMg = 171, PawnValueEg = 240, - KnightValueMg = 764, KnightValueEg = 848, - BishopValueMg = 826, BishopValueEg = 891, - RookValueMg = 1282, RookValueEg = 1373, - QueenValueMg = 2500, QueenValueEg = 2670, - FersValueMg = 400, FersValueEg = 400, - AlfilValueMg = 300, AlfilValueEg = 300, - SilverValueMg = 600, SilverValueEg = 600, - AiwokValueMg = 2500, AiwokValueEg = 2500, - AmazonValueMg = 3000, AmazonValueEg = 3000, - KnibisValueMg = 800, KnibisValueEg = 800, - BiskniValueMg = 800, BiskniValueEg = 800, - ShogiPawnValueMg = 100, ShogiPawnValueEg = 100, - LanceValueMg = 300, LanceValueEg = 300, - ShogiKnightValueMg = 300, ShogiKnightValueEg = 300, - EuroShogiKnightValueMg = 400, EuroShogiKnightValueEg = 400, - GoldValueMg = 600, GoldValueEg = 600, + PawnValueMg = 171, PawnValueEg = 240, + KnightValueMg = 764, KnightValueEg = 848, + BishopValueMg = 826, BishopValueEg = 891, + RookValueMg = 1282, RookValueEg = 1373, + QueenValueMg = 2500, QueenValueEg = 2670, + FersValueMg = 400, FersValueEg = 400, + AlfilValueMg = 300, AlfilValueEg = 300, + SilverValueMg = 600, SilverValueEg = 600, + AiwokValueMg = 2500, AiwokValueEg = 2500, + BersValueMg = 2500, BersValueEg = 2500, + ChancellorValueMg = 2500, ChancellorValueEg = 2500, + AmazonValueMg = 3000, AmazonValueEg = 3000, + KnibisValueMg = 800, KnibisValueEg = 800, + BiskniValueMg = 800, BiskniValueEg = 800, + ShogiPawnValueMg = 100, ShogiPawnValueEg = 100, + LanceValueMg = 300, LanceValueEg = 300, + ShogiKnightValueMg = 300, ShogiKnightValueEg = 300, + EuroShogiKnightValueMg = 400, EuroShogiKnightValueEg = 400, + GoldValueMg = 600, GoldValueEg = 600, MidgameLimit = 15258, EndgameLimit = 3915 }; @@ -215,7 +217,7 @@ const int PIECE_TYPE_BITS = 5; // PIECE_TYPE_NB = pow(2, PIECE_TYPE_BITS) enum PieceType { NO_PIECE_TYPE, PAWN, KNIGHT, BISHOP, ROOK, - QUEEN, FERS, MET = FERS, ALFIL, SILVER, KHON = SILVER, AIWOK, + QUEEN, FERS, MET = FERS, ALFIL, SILVER, KHON = SILVER, AIWOK, BERS, DRAGON = BERS, CHANCELLOR, AMAZON, KNIBIS, BISKNI, SHOGI_PAWN, LANCE, SHOGI_KNIGHT, EUROSHOGI_KNIGHT, GOLD, KING, ALL_PIECES = 0, diff --git a/src/variant.cpp b/src/variant.cpp index df0820e..cddc017 100644 --- a/src/variant.cpp +++ b/src/variant.cpp @@ -203,6 +203,33 @@ void VariantMap::init() { v->castling = false; return v; } (); + const Variant* almost = [&]{ + Variant* v = new Variant(); + v->remove_piece(QUEEN); + v->add_piece(CHANCELLOR, 'c'); + v->startFen = "rnbckbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBCKBNR w KQkq - 0 1"; + v->promotionPieceTypes = {CHANCELLOR, ROOK, BISHOP, KNIGHT}; + return v; + } (); + const Variant* chigorin = [&]{ + Variant* v = new Variant(); + v->add_piece(CHANCELLOR, 'c'); + v->startFen = "rbbqkbbr/pppppppp/8/8/8/8/PPPPPPPP/RNNCKNNR w KQkq - 0 1"; + v->promotionPieceTypes = {QUEEN, CHANCELLOR, ROOK, BISHOP, KNIGHT}; + return v; + } (); + const Variant* shatar = [&]{ + Variant* v = new Variant(); + v->remove_piece(QUEEN); + v->add_piece(BERS, 'j'); + v->startFen = "rnbjkbnr/ppp1pppp/8/3p4/3P4/8/PPP1PPPP/RNBJKBNR w - - 0 1"; + v->promotionPieceTypes = {BERS}; + v->doubleStep = false; + v->castling = false; + v->bareKingValue = VALUE_DRAW; + // TODO: illegal checkmates + return v; + } (); // Add to UCI_Variant option add("chess", chess); @@ -223,6 +250,9 @@ void VariantMap::init() { add("euroshogi", euroshogi); add("minishogi", minishogi); add("losalamos", losalamos); + add("almost", almost); + add("chigorin", chigorin); + add("shatar", shatar); } void VariantMap::add(std::string s, const Variant* v) {