chess-moves
v1.3.1
Published
Simple library for making moves using [chess.js](https://github.com/jhlywa/chess.js) with the intention of using the state for showing [Chessground](https://github.com/lichess-org/chessground) board.
Downloads
2
Readme
chess-moves ·
Simple library for making moves using chess.js with the intention of using the state for showing Chessground board.
Why?
When getting started trying to make my own chess applications, writing the turn logic was always a bit difficult to get started. This library is intended to make writing turn logic and making moves easier by providing a smaller interface to work with. In addition to that it is also geared towards using Chessground as the graphical representation. These functions return small games states that should make rendering your board easier to manage.
Installation
Run the following command to install the most recent version of chess.js from NPM:
npm install chess-moves
Example Code
import { createChessGame } from 'chess-moves';
const chessGame = createChessGame();
// AI Plays white
let delta = chessGame.playAiMove();
// User Plays Black
delta = chessGame.playUserMove({ from: 'e7', to: 'e5' });