1.1.4 • Published 3 years ago
tschess v1.1.4
Chess API written in typescript for chessishard.com
It is entirely functional, immutable, and free of side effects.
Based on Scala Chess.
Install
`yarn add tschess --save`
import { ts, // types
actor, // actor
move, // move
dir, // direction
disp, // displace
dt, // dtypes
board, // board
san, // san
uci, // uci
} from 'tschess';
Api
See index.ts for exported names.
Move with San
import { nt, f, m, san, tssan } from 'tschess';
// export function moveOrCastle(sanOrCastle: nt.SanMetaOrCastles, situation: nt.Situation): nt.Maybe<tt.Move>;
let e4 = tssan.moveOrCastle(san.str2meta('e4')!, f.situation(nt.initialFen)!)!;
f.fen(m.situationAfter(e4)) // returns fen after e4 move.
Move with Uci
Similar functions for Uci type.