shaack / cm-chess Goto Github PK
View Code? Open in Web Editor NEWIt's like chess.js, but in ES6 and can handle variations
License: MIT License
It's like chess.js, but in ES6 and can handle variations
License: MIT License
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
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)
Any idea what could be going wrong?
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.
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?
const chess = new cm.Chess()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.