cchess 0.0.7 copy "cchess: ^0.0.7" to clipboard
cchess: ^0.0.7 copied to clipboard

Chinese chess rule analysis, supported Chess-manual load, piece move, checkmate, move translate.

CChess

Chinese chess rule analysis, supported Chess-manual load, piece move, checkmate, move translate.

Features #

  • Load from manual
  • Load from fenstr
  • Translate move
  • Get all moves of a piece
  • Check whether the move complies with the rules
  • Check is checkmate
  • Check killed
  • Check tracked

Usage #

// Load from fenstr
ChessRule rule = ChessRule.fromFen(
    'rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR w - - 0 1');
// can checkmate
rule.teamCanCheck(0);
// get pieces has been eaten
List<ChessItem> beEatens = rule.getBeEatenList(0);
// is checkmating
rule.isCheck(eTeam);
// can parry checkmate or will be kill
rule.canParryKill(eTeam)
copied to clipboard

Additional information #

Full Demo

2
likes
160
points
39
downloads

Publisher

verified publishershirne.com

Weekly Downloads

2024.07.08 - 2025.01.20

Chinese chess rule analysis, supported Chess-manual load, piece move, checkmate, move translate.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

logging

More

Packages that depend on cchess