[ 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.
Centennial Chess
This is another chess variant that is quite popular on this site. In contains the innovative feature of an asymmetric piece (the Rotating Spearman) that can change its orientation at the end of its turn, deciding how it will be able to move the next time. It also contains several other unorthodox pieces, and thus makes a grateful subject for presentation as interactive diagram:
Piece overview (click on the piece name to display its moves)
Spearman orientation
The main challenge here of course was to implement the re-orietation of the Spearmen. This required some extra scripting, through one of the standard 'hooks' of the basic diagram script, providing the (optional) function 'WeirdPromotion'. Because the re-orietation of the Spearmen is treated as promotion of one piece type to another, where Middle,Left and Right Spearman are defined as three different piece types.
To make this work satisfactorily, the basic JavaScript powering the diagram had to be enhanced a bit, because it was necessary to make WeirdPromotion invoke the promotion procedure normally used in wester Chess variants, where you can select the promotion piece from the table by clicking there. Before this WeirdPromotion wasonly used in Shogi variants, where there is no choice other than to promote or not. The was solved by making the choice of the (normally non-existent) piece number 1022 indicated by WeirdPromotion be interpreted as a wildcard, allowing the user to select the actual piece from the table. Since WeirdPromotion (when supplied) is called after every move, it just has to test whether the moved piece is one of the Spearmen orientations, and if it is, wait for the user to select the new orientation.
To make this selection of new Spearman orientation easier, the table of pieces is printed next to the board permanently, rather than in the default way as an initially collapsed table under the board. Placement of the table anywhere in the page can be achieved by defining a HTML element <table id="pieceTable"></table> in the desired location.
Castling
Castling was also a bit problematic in this variant, because the King moves a different number of squares on the King side and Queen side. While the setup is such that what is left for white is right for black. So using Betza l and r modifiers would need a different description for white and black King. A new feature was added to the basic diagram script to handle this situation in a more convenient way: a new parameter 'castleFlip', when set to '1' in the diagram definition, will cause the meaning of left and right to be reversed when interpreting the XBetza description of castling for a black piece.