1.3.1 • Published 2 years ago

chess-moves v1.3.1

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

chess-moves · GitHub Workflow Status (branch) npm

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' });
1.2.0

2 years ago

1.1.1

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago