Skip to content
프로젝트

소개

체스 수 생성 및 검증, 기물 배치 및 이동, 체크·체크메이트·무승부 감지를 지원하는 TypeScript 체스 라이브러리입니다.

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
+2
in 7 days
+7
in 15 days
+16
in 1 month
+27

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

logo

chess.js

GitHub Workflow Status npm npm

chess.js is a TypeScript chess library used for chess move generation/validation, piece placement/movement, and check/checkmate/stalemate detection - basically everything but the AI.

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

Documentation

This README provides a quick example, full documentation can be found at https://jhlywa.github.io/chess.js.

Installation

Run the following command to install the most recent version of chess.js from NPM:

npm install chess.js

Example Code

The code below plays a random game of chess:

import { Chess } from 'chess.js'

const chess = new Chess()

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

Contributing

If you have any questions, suggestions, or find any bugs please open an issue. PRs are very welcome too, please read the Contributing Guide first to help make it a smooth process.

관련 프로젝트 살펴보기

불러오는 중…