Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bdeering1/lucida
Chess engine developed from scratch using Node.
https://github.com/bdeering1/lucida
jest nodejs typescript
Last synced: 2 days ago
JSON representation
Chess engine developed from scratch using Node.
- Host: GitHub
- URL: https://github.com/bdeering1/lucida
- Owner: Bdeering1
- License: mit
- Created: 2020-11-19T21:41:25.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-23T21:01:44.000Z (about 1 year ago)
- Last Synced: 2024-12-09T15:13:53.840Z (about 2 months ago)
- Topics: jest, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 663 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![lucida-wide](https://user-images.githubusercontent.com/55864293/224823456-b7999225-9a99-4934-9f29-7cf8e53f1234.gif)
*NodeJS chess engine developed using typescript*
## Features
### Board
Lucida uses an [10x12 board](https://www.chessprogramming.org/10x12_Board) supplemented by [piece-lists](https://www.chessprogramming.org/Piece-Lists) to keep track of pieces. The center 64 squares represent the actual board, and the additional padding is used to simplify move generation. The board representation must also keeps track of move count, side to move, castle permissions, the [en passent](https://www.chess.com/terms/en-passant) square, and the [fifty move](https://en.wikipedia.org/wiki/Fifty-move_rule) counter.
### Search
Lucida performs a depth-first search using [negamax](https://www.chessprogramming.org/Negamax) with [alpha beta pruning](https://www.chessprogramming.org/Alpha-Beta), which is extended by a [quiescence search](https://www.chessprogramming.org/Quiescence_Search) (with [delta](https://www.chessprogramming.org/Delta_Pruning) and [SEE](https://www.chessprogramming.org/Static_Exchange_Evaluation) pruning) to improve search accuracy. Effective move ordering improves the efficacy of pruning since better lines will be searched first. Moves are also ordered using promotion, capture, and piece-square table scores (see below).The search is first performed at a low depth and then repeated with increasing depth until a maximum time or depth is reached (see [iterative deepening](https://www.chessprogramming.org/Iterative_Deepening)). This strategy is effective because each search adds to the [transposition table](https://www.chessprogramming.org/Transposition_Table) (which allows previously evaluated scores to be re-used), and improves move ordering for future searches by keeping track of [PV nodes](https://www.chessprogramming.org/Node_Types#PV-Nodes).
### Evaluation
Lucida's evaluation consists of the material score, [mobility score](https://www.chessprogramming.org/Mobility), and [piece-square tables](https://www.chessprogramming.org/Piece-Square_Tables) for both the opening and endgame. The scores from these two tables are interpolated between to get the score for a given position (see [tapered eval](https://www.chessprogramming.org/Tapered_Eval)). There are also piece specific components to the evaluation - ie. rooks prefer open files, kings prefers having a pawn shield.### Strength
The current iteration of Lucida beats Komodo 17 (2100 rating) given ~5-10 seconds per move (on 2.8 GHz Quad-Core Intel Core i7).