template <> bool set(const std::string& value, MaterialCounting& target) {
target = value == "janggi" ? JANGGI_MATERIAL
: value == "unweighted" ? UNWEIGHTED_MATERIAL
+ : value == "whitedrawodds" ? WHITE_DRAW_ODDS
+ : value == "blackdrawodds" ? BLACK_DRAW_ODDS
: NO_MATERIAL_COUNTING;
- return value == "janggi" || value == "unweighted" || value == "none";
+ return value == "janggi" || value == "unweighted"
+ || value == "whitedrawodds" || value == "blackdrawodds" || value == "none";
}
template <> bool set(const std::string& value, CountingRule& target) {
: count(WHITE, ALL_PIECES) < count(BLACK, ALL_PIECES) ? -VALUE_MATE
: VALUE_DRAW;
break;
+ case WHITE_DRAW_ODDS:
+ result = VALUE_MATE;
+ break;
+ case BLACK_DRAW_ODDS:
+ result = -VALUE_MATE;
+ break;
default:
assert(false);
result = VALUE_DRAW;
};
enum MaterialCounting {
- NO_MATERIAL_COUNTING, JANGGI_MATERIAL, UNWEIGHTED_MATERIAL
+ NO_MATERIAL_COUNTING, JANGGI_MATERIAL, UNWEIGHTED_MATERIAL, WHITE_DRAW_ODDS, BLACK_DRAW_ODDS
};
enum CountingRule {
v->castling = false;
return v;
}
+ // Armageddon Chess
+ // https://en.wikipedia.org/wiki/Fast_chess#Armageddon
+ Variant* armageddon_variant() {
+ Variant* v = fairy_variant_base();
+ v->materialCounting = BLACK_DRAW_ODDS;
+ return v;
+ }
Variant* fairy_variant() {
Variant* v = chess_variant();
v->add_piece(SILVER, 's');
add("normal", chess_variant());
add("fischerandom", chess960_variant());
add("nocastle", nocastle_variant());
+ add("armageddon", armageddon_variant());
add("fairy", fairy_variant()); // fairy variant used for endgame code initialization
add("makruk", makruk_variant());
add("makpong", makpong_variant());
# [PieceType]: a piece type [letters defined for pieces, e.g., p]
# [Bitboard]: list of squares [e.g., d4 e4 d5 e5]. * can be used as wildcard for files (e.g., *1 is the first rank)
# [Value]: game result for the side to move [win, loss, draw]
-# [MaterialCounting]: material couting rules for adjudication [janggi, unweighted, none]
+# [MaterialCounting]: material couting rules for adjudication [janggi, unweighted, whitedrawodds, blackdrawodds, none]
# [CountingRule]: makruk or ASEAN counting rules [makruk, asean, none]
### Rule definition options