Chess engine for JavaScript