veloce / cordova-plugin-stockfish

Cordova interface for the Stockfish chess engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cordova-plugin-stockfish

Cordova interface for the Stockfish chess engine.

Exemple apps

Requirements

Usage

Stockfish global object exposes only 4 methods. Except for output, they all return promises:

// init engine
Stockfish.init().then(() => console.log('engine ready'))

// send commands
Stockfish.cmd('position startpos').then(() => console.log('command success'))

// register output listener
Stockfish.output(function(message) {
  console.log('stockfish message received:', message)
})

// exit engine
Stockfish.exit().then(() => console.log('engine successfully exited'))

Upgrade stockfish (lichess)

git remote add stockfish https://github.com/ddugovic/Stockfish.git
git subtree pull --prefix=src/share/stockfish --squash stockfish master

Build android

To build the native code in your project, just launch the gradle build using cordova build or cordova run command.

Build IOS

Through XCode, in the build settings menu:

  • Set C++ Language Dialect option to C++11 value.
  • Set C++ Standard Library option to lib++ value.

To enable variants and skill, in custom compiler flags, Other C++ flags section, add:

-DKOTH -DTHREECHECK -DATOMIC -DHORDE -DRACE -DANTI -DCRAZYHOUSE

About

Cordova interface for the Stockfish chess engine

License:GNU General Public License v3.0


Languages

Language:C++ 95.3%Language:Makefile 2.5%Language:Shell 0.9%Language:Java 0.6%Language:Objective-C++ 0.5%Language:JavaScript 0.1%Language:Objective-C 0.0%