Check out Makruk (Thai Chess), our featured variant for March, 2025.


[ 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

Xiangqi: Chinese Chess. Links and rules for Xiangqi (Chinese Chess). (9x10, Cells: 90) (Recognized!)[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Fri, Apr 25 09:19 PM UTC in reply to Fergus Duniho from 08:37 PM:

Indeed, multiple Diagrams on one page can be problematic; the script wasn't really designed for that. Especially if a Diagram needs to be interfaced with some external element, such as custom JavaScript embedded in the page, piece lists or tables embedded in the text, or buttons to change Diagram parameters, there can easily be confusion about which Diagram these belong to. What makes it worse is that each Diagram usually cames with its own link to a betza.js script, and if they use different versions it will be the last link on the page that will prevail. Which could be an obsolete version not implementing what an earlier Diagram relies on.

To make life easier I now made all the betza.js scripts save the Diagram numbers in the global array sats[], which can be indexed by the satellite value of the sought Diagram. Buttons could use that info to make sure they will always act on the right Diagram; they should call TwitchDiag(sats['satelliteValue']) before they start changing any parameters.