Skip to content

foo123/chess.js

Repository files navigation

Chess

Chess Game, Chess Board, Chess Engine and Chess Exercises

chess game browser

chess game terminal

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 and sunfish.js chess engines are included, that either a human or an algorithm can play against.

About

Chess Game, Chess Board, Chess Engine and Chess Exercises

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors