tschess
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i tschess

Weekly Downloads

5

Version

1.1.4

License

MIT

Unpacked Size

232 kB

Total Files

174

Last publish

Collaborators

  • eguneys