Closed ngocdaothanh closed 6 years ago
There are 2 ways to do so.
1/ providing the list of moves that lead to the board state 2/ providing the initial board state directly
This can also be combined: start a game with an initial board state then a number of moves afterwards.
Either way, this is done through the load()
method, passing an object with property playedMoves
describing the moves, initialBoard
for the static starting board state. You can find an example of this here.
Note that only some games support initialBoard
, namely the Chess variants using the FEN notation, and Checkers variants.
Thanks!
I intended to edit the wiki page to add the info to getInitialBoardState
, but I couldn't find the edit button, so @mi-g please edit it.
https://github.com/mi-g/jocly/wiki/Match-API-Object says that there are methods
getBoardState
andgetInitialBoardState
.But how to set board initial state?
For example, Chess960 has 960 initial states. How can I create a match with a specified FEN?