Check out Glinski's Hexagonal Chess, our featured variant for May, 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

Interactive diagrams. Diagrams that interactively show piece moves.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Thu, Feb 15 07:44 AM UTC in reply to Daniel Zacharias from 03:56 AM:

In the promoChoice the pieces must optionally be separated by commas. That is, if there is a comma anywhere in the string, the string is split at the commas to get the piece IDs. If not, strange things could happen if the piece IDs are not single letters. (It then just looks if the ID occurs as a substring, while otherwise it looks whether the ID sandwidched between commas is occurs as a substring of promoOffset sandwidched between commas.)

It is on the to-do list to use the same system in individual rows of the morph and captureMatrix. So that you would not have to use commas throughout the entire matrix if you need it in just a few rows. (Usually these matrices are pretty sparse.) If you really need this I could give implementation of this priority.

A * refers to the first set in promoChoice, a 1 to the second. (Or one could imagine counting of the sets starts at 0.) This is partly historic accident, as a 0 in the captureMatrix was already defined as kamikaze capture before alternate sets were introduced and the the promotion zone was indicated by *.

There is a subtlety here that I did not foresee, and yet has to be resolved: would you promote on entering the zone, or in every case where you end the move in it. This becomes important when you can defer promotion, (which is standard in shogi variants), or in a more general case whenever you can promote to pieces that themselves can promote. It seems undesirable to have different behavior here on promotions specified by morph=* and those controlled by promoZone/maxPromote, as the main reason for introducing * in the morph boards was to handle irregular promotion zones (e.g. on diamond-shaped boards, or in diagonal variants). But I don't think this is currently the case. (The current rules for the normal zone are complex anyway, and depend on promoOffset and holdingsType, to get the desired behavior in regular Shogi, Chu Shogi and Grand Chess.)

Since 0 has no meaning yet in the morph boards (defining squares where pieces would disappear seemed pointless; no one would move there, and you might as well make them inaccessible), it could be made to refer to the first promoChoice set, but with alternative rules w.r.t. where you came from.

[Edit] It appears the comma notation was already implemented for morph. I now also implemented it in captureMatrix. (All untested, though, and only in betzaNew.js.)