All Projects → lubert → chess.ts

lubert / chess.ts

Licence: BSD-2-Clause license
A Typescript chess library for chess move generation/validation, piece placement/movement, and check/checkmate/draw detection

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to chess.ts

isepic-chess
♞ JavaScript chess utility library.
Stars: ✭ 16 (-15.79%)
Mutual labels:  chess
syzygy-tables.info
User interface and public API for probing Syzygy endgame tablebases
Stars: ✭ 49 (+157.89%)
Mutual labels:  chess
jerry
Jerry - Chess Program
Stars: ✭ 79 (+315.79%)
Mutual labels:  chess
ConvChess
Convolutional Neural Networks learns to play chess moves
Stars: ✭ 14 (-26.32%)
Mutual labels:  chess
FabChess
UCI compliant chess engine written in Rust
Stars: ✭ 27 (+42.11%)
Mutual labels:  chess
Batch-First
A JIT compiled chess engine which traverses the search tree in batches in a best-first manner, allowing for neural network batching, asynchronous GPU use, and vectorized CPU computations.
Stars: ✭ 27 (+42.11%)
Mutual labels:  chess
chess
An R package to read, write, create and explore chess games
Stars: ✭ 60 (+215.79%)
Mutual labels:  chess
renpy-chess
A chess GUI built with Ren'Py, python-chess, and Stockfish. Version 2.0 of https://github.com/RuolinZheng08/renpy-chess-engine
Stars: ✭ 36 (+89.47%)
Mutual labels:  chess
elephantfish
elephantfish: 一个只有124行的中国象棋引擎
Stars: ✭ 129 (+578.95%)
Mutual labels:  chess
chessops
Chess and chess variant rules and operations in TypeScript
Stars: ✭ 66 (+247.37%)
Mutual labels:  chess
uci
A thin wrapper on a uci chess engine
Stars: ✭ 33 (+73.68%)
Mutual labels:  chess
Checkmate
A human vs human chess game build on basic JAVA.
Stars: ✭ 15 (-21.05%)
Mutual labels:  chess
OpenChess
A cross-platform chess game.
Stars: ✭ 18 (-5.26%)
Mutual labels:  chess
pogchamps
Next/React + Symfony project covering the Pogchamps chess.com tournaments
Stars: ✭ 27 (+42.11%)
Mutual labels:  chess
FDChessboardView
An iOS / Mac view controller for chess boards
Stars: ✭ 75 (+294.74%)
Mutual labels:  chess
underwater-chess
Chess, written in React, driven by a Stockfish-powered API
Stars: ✭ 20 (+5.26%)
Mutual labels:  chess
rustic
Rustic is a chess engine. It is written from scratch, in the Rust programming language.
Stars: ✭ 68 (+257.89%)
Mutual labels:  chess
chess.com
Python wrapper for Chess.com Published-Data API
Stars: ✭ 34 (+78.95%)
Mutual labels:  chess
chessbot
Slack bot for playing chess.
Stars: ✭ 32 (+68.42%)
Mutual labels:  chess
shakmaty-syzygy
A Rust library to probe Syzygy endgame tablebases
Stars: ✭ 14 (-26.32%)
Mutual labels:  chess

chess.ts

Build Status npm

chess.ts is a chess library and rewrite of chess.js in Typescript that is used for chess move generation/validation, piece placement/movement, and check/checkmate/stalemate detection - basically everything but the AI.

chess.ts has been extensively tested in node.js and most modern browsers.

Installation

To install the stable version:

# NPM
npm install chess.ts

# Yarn
yarn add chess.ts

Documentation

Example Code

The code below plays a random game of chess:

import { Chess } from 'chess.ts'
const chess = new Chess()

while (!chess.game_over()) {
  const moves = chess.moves()
  const move = moves[Math.floor(Math.random() * moves.length)]
  chess.move(move)
}
console.log(chess.pgn())

User Interface

By design, chess.ts is headless and does not include user interface. Many developers have had success integrating chess.ts with the chessboard.js library. See chessboard.js - Random vs Random for an example.

BUGS

  • The en passant square and castling flags aren't adjusted when using the put/remove functions (workaround: use .load() instead)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].