crisp_chess_engine 0.8.0 copy "crisp_chess_engine: ^0.8.0" to clipboard
crisp_chess_engine: ^0.8.0 copied to clipboard

A pure-Dart chess engine — alpha-beta search with null-move pruning, PVS, quiescence and a transposition table. No native code; runs everywhere Dart does.

example/crisp_chess_engine_example.dart

// Finds the best move in a few positions with the pure-Dart engine.
// Run with: dart run example/crisp_chess_engine_example.dart
import 'package:crisp_chess_engine/crisp_chess_engine.dart';

void main() {
  // A back-rank mate in one — the engine should play Ra8#.
  final mate = searchPosition('6k1/5ppp/8/8/8/8/5PPP/R5K1 w - - 0 1', depth: 4);
  print('mate-in-1 best move: ${mate?.bestMove}  (score ${mate?.score})');

  // The opening position — any sound first move, searched to depth 5.
  final opening = searchPosition(
    'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
    depth: 5,
  );
  print('opening best move:   ${opening?.bestMove}  '
      '(${opening?.nodesSearched} nodes, depth ${opening?.depth})');
}
0
likes
160
points
340
downloads

Documentation

API reference

Publisher

verified publishercrispstro.be

Weekly Downloads

A pure-Dart chess engine — alpha-beta search with null-move pruning, PVS, quiescence and a transposition table. No native code; runs everywhere Dart does.

Repository (GitHub)
View/report issues

Topics

#chess #engine #alpha-beta #game-ai

License

MIT (license)

Dependencies

chess

More

Packages that depend on crisp_chess_engine