[ 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.
Just a little advice on how this could be done without including additional JavaScript on the page. What you want is that some pieces change type in a pre-determined way when they reach last rank. That is what the Diagram calls 'morphing', and you could achieve it by including a line morph=X below the definition of the piece you want to morph into an 'X'. The X here is a shorthand for a board image with X everywhere on the last rank, as the rule is that ranks are written high to low, separated by slashes (as in FEN), nothing happens on omitted ranks, and incomplete ranks are filled by repeating what you wrote (which was just X, so XXXXXXXX).
So you could have suppressed normal promotion by setting maxPromote=0, and included a morph= for Pawn, Soldier, Phoenix and Kirin. (Or you could have kept normal promotion for Pawn and Soldier by setting maxPromote=2, and make that automatic by promoChoice=Q, and only use morphs for Phoenix and Kirin.)
One advantage is that you can refer to pieces by their ID this way, so that you wouldn't make the mistake of using a wrong number for the piece type. Even whn you decided to add extra piece types later.