Skip to content

eguneys/tschess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published