JamesTeague / chess-moves

Simple library for making moves using chess.js with the intention of using the state for showing chessground board.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Simple library for making moves using chess.js with the intention of using the state for showing chessground board.

License:GNU General Public License v3.0


Languages

Language:TypeScript 99.9%Language:Shell 0.0%Language:JavaScript 0.0%