mirror of
https://github.com/lichess-org/dartchess.git
synced 2026-05-26 13:51:01 +00:00
e79a901409f325e11cb49218270d8bc6f4681a03
This is closer to what Scalachess does and makes the code more readable. _hordeBishops() now always returns the bishops of the Horde and _piecesBishops always returns the bishops of the pieces.
Chess and chess variant rules written in dart for native platforms (does not support web).
Features
- Completely immutable Position class
- Read and write FEN
- Read and write SAN
- Chess rules:
- move making
- legal moves generation
- game end and outcome
- insufficient material
- setup validation
- Chess960 support
- Chess variants: Antichess, Atomic, Crazyhouse, KingOfTheHill, ThreeCheck
- PGN parser and writer
- Bitboards
- Attacks and rays using hyperbola quintessence
Example
import 'package:dartchess/dartchess.dart';
final pos = Chess.fromSetup(Setup.parseFen('r1bqkbnr/ppp2Qpp/2np4/4p3/2B1P3/8/PPPP1PPP/RNB1K1NR b KQkq - 0 4'));
assert(pos.isCheckmate == true);
Additional information
This package was heavily inspired from:
Languages
Dart
100%