[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]
Check out Janggi (Korean Chess), our featured variant for December, 2024.
Check out Janggi (Korean Chess), our featured variant for December, 2024.
I have changed cbPiecesFromFEN() a bit: instead of returning the pieceTypes object, it now returns a larger object that has pieceTypes in it as one of its properties. This so that I can return also other stuff, such as a standard promotion routine. So a game definition using it would now look like this:
Promotion would be by default on the last rank, to any non-royal non-pawn piece (i.e. not to P or S).
To make it possible to use this in combination with pieces that are not supprted, I also defined a few methods in the returned object to allow you to alter it. So in the example above you could use
to add a new piece type that you defined yourself in the old way. It would not automatically be added to teh promotion choice, but you could do that through
It would also be possible to completely alter the promotion choice by setting
with an array of your own choice. You could also alter the depth of the promotion zone through
To alter (or add completely new) properties of a piece that was automatically geneated from the FEN you can use
Next thing would be to also provide a default castling table. That would in fact make it possible to just write
in the game definition.
Note that when the FEN has more ranks than the board size defined in the geometry, the pieces mentioned on the extra ranks will have their types defined, but will not be in the initial setup.
I still have to debug and push all this.