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
- Host: GitHub
- URL: https://github.com/foo123/chess.js
- Owner: foo123
- Created: 2026-04-11T13:51:03.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-28T10:21:03.000Z (about 2 months ago)
- Last Synced: 2026-04-28T12:12:27.392Z (about 2 months ago)
- Topics: chess, chess-board, chess-engine, chess-exercises, chess-game
- Language: JavaScript
- Homepage: https://foo123.github.io/examples/chess-play/
- Size: 5.53 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chess
Chess Game, Chess Board, Chess Engine and Chess Exercises


## 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.