Skip to content
المشاريع

حول

مكتبة شطرنج مكتوبة بـ TypeScript لتوليد النقلات والتحقق من صحتها، ووضع القطع وتحريكها، واكتشاف الكش والكش مات والتعادل

أدوات التطوير

كيف تُقاس هذه الأرقام

4,474 نجمة999 التفرعات +2 خلال 24 ساعة

النمو المقاس للنجوم

خلال 24 ساعة
+٢
خلال 7 أيام
+٧
خلال 15 يومًا
+١٦
خلال شهر
+٢٧

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

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.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…