Skip to content

Makruk (thai chess) rules and operations in TypeScript.

License

Notifications You must be signed in to change notification settings

thaichess-org/makrukops

 
 

Repository files navigation

chessops

Test npm

Makruk rules and operations in TypeScript.

Features

  • Read and write FEN
  • Vocabulary
    • Square
    • SquareSet (implemented as bitboards)
    • Color
    • Role (piece type)
    • Piece (Role and Color)
    • Board (map of piece positions)
    • Setup (a not necessarily legal position)
    • Position (base class for legal positions, Makruk is a concrete implementation)
  • Attacks and rays using Hyperbola Quintessence (faster to initialize than Magic Bitboards)
  • Read and write UCI move notation
  • Read and write SAN
  • Read and write PGN
    • Parser supports asynchronous streaming
    • Game tree model
    • Transform game tree to augment nodes with arbitrary user data
    • Parse comments with evaluations, clocks and shapes
  • Transformations: Mirroring and rotating
  • Compatibility: makrukground

Example

import { parseFen } from 'makrukops/fen';
import { Makruk } from 'makrukops/makruk';

const setup = parseFen('rnsmksnr/8/pppppppp/8/8/PPPPPPPP/8/RNSKMSNR 2 - - 0 1').unwrap();
const pos = Makruk.fromSetup(setup).unwrap();
console.assert(pos.isLegal());

License

makrukops is licensed under the GNU General Public License 3 or any later version at your choice. See LICENSE.txt for details.

About

Makruk (thai chess) rules and operations in TypeScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.7%
  • JavaScript 0.3%