shaack / cm-chessboard

A JavaScript chessboard without dependencies. Rendered in SVG, coded in ES6. Views FEN, handles move input, animated, responsive, expandable
MIT License
209 stars 63 forks source link

setPosition for new Chess()? #135

Closed ezz3r closed 5 months ago

ezz3r commented 5 months ago

"board.setPosition(chessboardState, true);"

So basically i am getting the chess fen from the database and it updates it visually. But not in the "chess engine". Is there a setPosition function for const chess?

"const chess = new Chess()"

ezz3r commented 5 months ago

I tried chess.setPosition() but that doesnt work :?

ezz3r commented 5 months ago

Ok i just found through testing. Solution: chess.load(fen)

shaack commented 5 months ago

It has mostly the same API as chess.js because it is based on chess.js