Skip to content

isaacl/stockfish.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3,872 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stockfish.js

The strong open source chess engine Stockfish compiled to JavaScript using Emscripten. See it in action for local computer analysis on lichess.org.

Downloads

About 1MB uncompressed, 220 KB gzipped:

Building

Install Emscripten, then:

cd src
make ARCH=js build

Usage

var stockfish = new Worker('stockfish.js');

stockfish.addEventListener('message', function (e) {
  console.log(e.data);
});

stockfish.postMessage('uci');

Changes to original Stockfish

  • Expose as web worker.
  • Web workers are inherently single threaded. Limit to one thread.
  • Break down main iterative deepening loop to allow interrupting search.
  • Limit total memory to 32 MB.
  • Disable Syzygy tablebases.
  • Disable benchmark.

Acknowledgements

Thanks to @nmrugg for doing the same thing with Stockfish 6, to @ddugovic for his multi-variant Stockfish fork and to the Stockfish team for ... Stockfish.

About

The strong open source chess engine Stockfish compiled to JavaScript using Emscripten

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 96.0%
  • Makefile 3.2%
  • Other 0.8%