bishop 1.3.0 copy "bishop: ^1.3.0" to clipboard
bishop: ^1.3.0 copied to clipboard

Bishop is a chess logic package with flexible variant support.

example/example.dart

import 'package:bishop/bishop.dart';

import 'play.dart';

void main(List<String> args) async {
  String v = args.isNotEmpty ? args.first : 'standard';
  Variant variant = variantFromString(v) ?? Variant.standard();
  print('Starting game with variant ${variant.name}');
  await Future.delayed(const Duration(seconds: 3));
  Game game = Game(variant: variant);
  int i = 0;

  while (!game.gameOver) {
    print(game.ascii());
    print(game.fen);
    Move m = game.getRandomMove();
    print('${Bishop.playerName[game.turn]}: ${game.toSan(m)}');
    game.makeMove(m);
    i++;
    if (i >= 200) break;
  }
  print(game.ascii());
  print(game.pgn());
  printCyan(game.result?.readable ?? 'Game Over (too long)');
}
30
likes
0
pub points
79%
popularity

Publisher

verified publisheralxbkr.xyz

Bishop is a chess logic package with flexible variant support.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on bishop