libedax4dart 0.5.0-beta.6 copy "libedax4dart: ^0.5.0-beta.6" to clipboard
libedax4dart: ^0.5.0-beta.6 copied to clipboard

outdated

Dart wrapper for libedax. With using libedax4dart, you can execute functions equivalent to edax.

example/example.dart

import 'dart:io';

import 'package:libedax4dart/libedax4dart.dart';

void main() {
  // initialize
  const initParams = ['', '-book-file', './resources/test_book.dat', '-level', '16'];
  final edax = LibEdax()
    ..libedaxInitialize(initParams)
    ..edaxInit();
  stdout.writeln(edax.edaxGetBoard().prettyString(edax.edaxGetCurrentPlayer()));

  /// play
  edax.edaxPlay('f5f6f7g7');
  stdout
    ..writeln(edax.edaxGetBoard().prettyString(edax.edaxGetCurrentPlayer()))
    ..writeln('moves: ${edax.edaxGetMoves()}')
    ..writeln('is game over ?: ${edax.edaxIsGameOver() ? 'YES' : 'NO'}')
    ..writeln('can move ?: ${edax.edaxCanMove() ? 'YES' : 'NO'}')
    ..writeln('BLACK discs: ${edax.edaxGetDisc(TurnColor.black)}')
    ..writeln('White discs: ${edax.edaxGetDisc(TurnColor.white)}');

  /// get hints
  final hintList = edax.edaxHint(2);
  stdout
    ..writeln('1st move: ${hintList.first.moveString}, ${hintList.first.scoreString}')
    ..writeln('2nd move: ${hintList[1].moveString}, ${hintList[1].scoreString}');

  // NOTE: If you use another command, See: https://sensuikan1973.github.io/libedax4dart/libedax4dart/LibEdax-class.html
}
4
likes
0
pub points
44%
popularity

Publisher

verified publisherdone-sensuikan1973.com

Dart wrapper for libedax. With using libedax4dart, you can execute functions equivalent to edax.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, meta

More

Packages that depend on libedax4dart