Check out Janggi (Korean Chess), our featured variant for December, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

JavaScript Chess-variant applet[Subject Thread] [Add Response]
H. G. Muller wrote on Tue, Nov 3, 2015 07:09 PM UTC:

As an example: It now produces the image above, from nothing more than the input listed below embedded in body of the html,

{div id="diagram"}
files=10
P:Pawn:fmWfceFifmnD:Pawn.png:a2,b2,c2,d2,e2,f2,g2,h2,i2,j2
N:Knight:N:Knight.png:b1,i1
B:Bishop:B:Bishop.png:d1,g1
R:Rook:R:Rook.png:a1,j1
A:Archbishop:BN:Archbishop.png:c1
C:Chancellor:RN:Chancellor.png:h1
Q:Queen:Q:Queen.png:e1
K:King:KisO2:King.png:f1
{/div}
(The braces of course have to be angular brackets, which cannot be displayed on this forum.) So you just have to list all the pieces, one per line in the format

pieceID : name : Betza move description : image : squares it starts on

plus a number of parameters (the choice is from files (8), ranks (8), holdingsType (0), promoZone (1), maxPromote (1), promoChoice (empty), graphicsDir (?), symmetry (mirror) and light/darkShade for the board checkering) of which you want to overrule the default (given between the parentheses). In this case that was only the number of board files. An empty string for the promoChoice means all promotions except to Pawn will be allowed. The graphicsDir should get a suitable default where many pieces are available.

If you want to see it in action, click here, as for now this only works on my own website.