GithubHelp home page GithubHelp logo

shaack / cm-chess Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 8.0 125 KB

It's like chess.js, but in ES6 and can handle variations

License: MIT License

JavaScript 97.37% HTML 2.63%
chess chessmail es6 javascript released

cm-chess's People

Contributors

goodvibs avatar kadirmaev avatar shaack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cm-chess's Issues

Not able to load PGN

Hi, I'm trying to reproduce the code that I see in one of the tests:

    const pgn = `[Event "IBM Kasparov vs. Deep Blue Rematch"]
    [Site "New York, NY USA"]
    [Date "1997.05.11"]
    [Round "6"]
    [White "Deep Blue"]
    [Black "Kasparov, Garry"]
    [Opening "Caro-Kann: 4...Nd7"]
    [ECO "B17"]
    [Result "1-0"]
    1.e4 c6 2.d4 d5 3.Nc3 dxe4 4.Nxe4 Nd7 5.Ng5 Ngf6 6.Bd3 e6 7.N1f3 h6
    8.Nxe6 Qe7 9.O-O fxe6 10.Bg6+ Kd8 {Kasparov schüttelt kurz den Kopf}
    11.Bf4 b5 12.a4 Bb7 13.Re1 Nd5 14.Bg3 Kc8 15.axb5 cxb5 16.Qd3 Bc6
    17.Bf5 exf5 18.Rxe7 Bxe7 19.c4 1-0`
    const test_chess =  new Chess();

    debugger;

    test_chess.loadPgn(pgn)

But I get this error:
image

Any idea what could be going wrong?

Chess history variants documentation

Hello!

I've been playing with your cm-chessboard library for a week in a Nuxt.js project (after trying a few other chessboard libraries), and I really enjoy it.

I saw that you also made cm-chess based on chess.js (which I am using now), so I'm considering switching to cm-chess because of the "chess history variants" feature.
However, I am not familiar with chess programming and chess libraries, so I don't know how to use it.
I was wondering if you could write and/or point me to some documentation about this feature.

Thank you for your work, I really enjoy it.

Usage in Angular

Hi! Im trying to add this library to my work project (we already use cm-chessboard) and face an issue:
Default Angular compiler do not recognize the module. Even if I add custom .d.ts file to declare non-typescript module.
The reeson seems to be in package.json in line

"main": "index.html"

If I replace it with

"main": "./src/cm-chess/Chess.js"

then all is OK. Can you fix this?

Chess960 support

seems that move from chess 960 is not supported now

const { Chess } = await import("cm-chess")
const c = new Chess('rnbqkbnr/pppppppp/8/8/8/3PP1BN/PPP2PPP/RNBQ1K1R w KQkq - 0 1');
c2.move('0-0'); // null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.