An open API service indexing awesome lists of open source software.

https://github.com/foo123/chess.js

Chess Game, Chess Board, Chess Engine and Chess Exercises
https://github.com/foo123/chess.js

chess chess-board chess-engine chess-exercises chess-game

Last synced: 21 days ago
JSON representation

Chess Game, Chess Board, Chess Engine and Chess Exercises

Awesome Lists containing this project

README

          

# Chess

Chess Game, Chess Board, Chess Engine and Chess Exercises

![chess game browser](/screenshot-browser.png)

![chess game terminal](/screenshot-terminal.png)

## ChessGame

Represents a game of chess, the possible moves, when the game is over and who wins.
version: 1.0.0

## ChessBoard

Represents the board of chess in HTML and in Terminal.
version: 1.0.0

## ChessSearch

Implements various search methods for a best move in a game of chess.
version: 0.11.0

Methods:
* Alpha Beta Search
* MTD(f) Search
* Best Node Search
* Monte Carlo Tree Search
* Hybrids of above methods

A user-defined evaluation function can be used, else a custom-crafted evaluation function is used which, although simple and fast, produces quite good results (see `tournament.js` for some tentative results).
The evaluation function should explicitly declare in the options the value of MATE (`opts.MATE`), and should return values strictly between `-MATE` (losing) and `MATE` (winning) and only `MATE/2` for a draw.

Related References:
1. "An analysis of alpha-beta pruning", Donald E. Knuth, Ronald W. Moore, 1975
2. "Best-first fixed-depth minimax algorithms", Aske Plaat, Jonathan Schaeffer, Wim Pijls, Arie de Bruin, 1996
3. "Fuzzified Algorithm for Game Tree Search with Statistical and Analytical Evaluation", Dmitrijs Rutko, 2011
4. "Bandit based Monte-Carlo Planning", Levente Kocsis and Csaba Szepesvári, 2006
5. "Monte Carlo Tree Search: A Review of Recent Modifications and Applications", Maciej Świechowski, Konrad Godlewski, Bartosz Sawicki, Jacek Mańdziuk, 2021
6. "Pruning Game Tree by Rollouts", Bojun Huang, 2015
7. "A Rollout-Based Search Algorithm Unifying MCTS and Alpha-Beta", Hendrik Baier, 2016

Additionally, copies of [stockfish.js](https://github.com/nmrugg/stockfish.js/) and [sunfish.js](https://github.com/foo123/sunfish.js/) chess engines are included, that either a human or an algorithm can play against.