Simple chess library, well typed by TypeScript.
# | DATE | TYPE |
---|---|---|
1.0.0-beta.1 | 07.08.2023 | beta |
1.0.0-beta.2 | 21.08.2023 | beta |
1.0.0-beta.3 | 21.08.2023 | beta |
1.0.0-beta.4 | 23.08.2023 | beta |
1.0.0-beta.5 | 23.08.2023 | beta |
npm i chlss
import {BoardObj} from "chlss";
// Will create an empty board,
const board = new BoardObj();
// You can use constructor
// parameter to specify initial FEN.
const boardWithFen = new BoardObj("<invalid-fen😅>");
const board = new BoardObj();
// Will load FEN position "FEN" to board.
board.fen("FEN");
import {IMove} from "./move";
const board = new BoardObj();
// Will return all legal moves in UCI.
const uci: string[] = board.legalMovesUci();
// Will return moves as chlss move.
const moves: IMove[] = board.legalMoves();
const board = new BoardObj();
// Will push e4 move.
boardObj.pushUci("e2e4");
const board = new BoardObj();
// Will return FEN representation of the board.
const fen = board.fen();
import {Termination} from "./termination";
const board = new BoardObj();
// Will return instance of Termination,
// if the game is ended.
let t: Termination | undefined = board.getTermination();
const board = new BoardObj();
// Will return colour to move.
const toMove: Colour = board.getColour();
chlss is well tested using thousands of random positions, but please report any issue you will see.
Thank You 😎
Kacper Faber