- [Seirawan](https://en.wikipedia.org/wiki/Seirawan_chess), Seirawan-Crazyhouse
- [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), New Zealand
-- [Antichess](https://lichess.org/variant/antichess), [Giveaway](http://www.chessvariants.com/diffobjective.dir/giveaway.old.html), [Losers](https://www.chessclub.com/help/Wild17), [Codrus](http://www.binnewirtz.com/Schlagschach1.htm)
+- [Antichess](https://lichess.org/variant/antichess), [Giveaway](http://www.chessvariants.com/diffobjective.dir/giveaway.old.html), [Suicide](https://www.freechess.org/Help/HelpFiles/suicide_chess.html), [Losers](https://www.chessclub.com/help/Wild17), [Codrus](http://www.binnewirtz.com/Schlagschach1.htm)
- [Extinction](https://en.wikipedia.org/wiki/Extinction_chess), [Kinglet](https://en.wikipedia.org/wiki/V._R._Parton#Kinglet_Chess)
- [King of the Hill](https://en.wikipedia.org/wiki/King_of_the_Hill_(chess)), [Racing Kings](https://en.wikipedia.org/wiki/V._R._Parton#Racing_Kings)
- [Three-check](https://en.wikipedia.org/wiki/Three-check_chess), Five-check
inline Value Position::stalemate_value(int ply) const {
assert(var != nullptr);
+ if (var->stalematePieceCount)
+ {
+ int c = count<ALL_PIECES>(sideToMove) - count<ALL_PIECES>(~sideToMove);
+ return c == 0 ? VALUE_DRAW : convert_mate_value(c < 0 ? var->stalemateValue : -var->stalemateValue, ply);
+ }
return convert_mate_value(var->stalemateValue, ply);
}
v->castling = false;
return v;
}
+ Variant* suicide_variant() {
+ Variant* v = antichess_variant();
+ v->stalematePieceCount = true;
+ return v;
+ }
Variant* codrus_variant() {
Variant* v = giveaway_variant();
v->promotionPieceTypes = {QUEEN, ROOK, BISHOP, KNIGHT};
add("losers", losers_variant());
add("giveaway", giveaway_variant());
add("antichess", antichess_variant());
+ add("suicide", suicide_variant());
add("codrus", codrus_variant());
add("extinction", extinction_variant());
add("kinglet", kinglet_variant());
bool nFoldValueAbsolute = false;
bool perpetualCheckIllegal = false;
Value stalemateValue = VALUE_DRAW;
+ bool stalematePieceCount = false; // multiply stalemate value by sign(count(~stm) - count(stm))
Value checkmateValue = -VALUE_MATE;
bool shogiPawnDropMateIllegal = false;
bool shatarMateRule = false;