draughts_engine 1.2.1
draughts_engine: ^1.2.1 copied to clipboard
A fast, fully rules-complete international 10x10 draughts engine for Dart & Flutter. Supports men & king movement, flying kings, multi-capture sequences, mandatory capture and longest-line rules, FEN [...]
import 'package:draughts_engine/draughts_engine.dart';
void main() {
// Standard start position (W:W31-50:B1-20)
final game = Draughts();
print('Turn: ${game.turn}');
print('FEN: ${game.fen}');
print('Result: ${game.getWinner()}');
final moves = game.moves();
print('Legal moves: ${moves.length}');
for (final m in moves.take(10)) {
print(' $m');
}
if (moves.isNotEmpty) {
// final m = moves.first;
// print('Playing: $m');
// game.move(m, fromve(mll, to: null);
// print('Turn: ${game.turn}');
// print('FEN: ${game.fen}');
// print('Result: ${game.result}');
}
}