https://github.com/imor/uci
A thin wrapper on a uci chess engine
https://github.com/imor/uci
chess chess-engine uci uci-engine
Last synced: 6 months ago
JSON representation
A thin wrapper on a uci chess engine
- Host: GitHub
- URL: https://github.com/imor/uci
- Owner: imor
- License: mit
- Created: 2013-07-29T15:33:16.000Z (about 12 years ago)
- Default Branch: gh-pages
- Last Pushed: 2021-05-07T06:06:20.000Z (over 4 years ago)
- Last Synced: 2025-03-28T07:22:37.974Z (7 months ago)
- Topics: chess, chess-engine, uci, uci-engine
- Language: JavaScript
- Homepage:
- Size: 4.16 MB
- Stars: 34
- Watchers: 8
- Forks: 18
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
UCI
===NOTE:This version is not backwards compatible with 0.2.x series of releases.
UCI is a thin wrapper on a [uci
interface](http://en.wikipedia.org/wiki/Universal_Chess_Interface) chess engine.## Installation
Make sure you have [node.js](http://nodejs.org/) installed. Then do:$ npm install uci
## Example
```js
var Engine = require('uci');
var engine = new Engine('');
engine.runProcess().then(function () {
console.log('Started');
return engine.uciCommand();
}).then(function (idAndOptions) {
console.log('Engine name - ' + idAndOptions.id.name);
return engine.isReadyCommand();
}).then(function () {
console.log('Ready');
return engine.uciNewGameCommand();
}).then(function () {
console.log('New game started');
return engine.positionCommand('startpos', 'e2e4 e7e5');
}).then(function () {
console.log('Starting position set');
console.log('Starting analysis');
return engine.goInfiniteCommand(function infoHandler(info) {
console.log(info);
});
}).delay(2000).then(function () {
console.log('Stopping analysis');
return engine.stopCommand();
}).then(function (bestmove) {
console.log('Bestmove: ');
console.log(bestmove);
return engine.quitCommand();
}).then(function () {
console.log('Stopped');
}).fail(function (error) {
console.log(error);
process.exit();
}).done();
```
## APISee [here](http://imor.github.io/uci/docs/src/main.html) for API reference.
## Contributing
Fork, pick an issue to fix from [issues](https://github.com/imor/uci/issues) or
add a missing feature and send a pull request.## License
UCI is released under the MIT License. See the bundled LICENSE file for details.