Check out Modern Chess, our featured variant for January, 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

Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Fri, Aug 21, 2020 04:11 PM UTC in reply to H. G. Muller from 11:13 AM:

The Mighty Lion and Odin's presets now use a slightly adapted version of movePiece JavaScript routine, which does take care of the highlighting after the list with remaining moves opens: it first clears all the highlights for the first leg, and then applies highlights to the destinations of a second leg, or to the squares where there are side effects. A third click on the board can then be used to select any of those, and submit the move (if it then is unique and legal).

I'm working toward something that will do that, but I need to be able to test it with Mighty Lion Chess.

Do all moves have to be written in $extralegal, to get them in the legalList?

No, moves set with setlegal are converted to text format for legalList.

It seems the highlighting now is done completely on the basis of legalList, and that legalMoves is no longer used for any other purpose than to switch on the highlighting, by testing it against null.

That was an oversight. I have now changed that to legalList, so that the legalMoves array is no longer used for anything.

The Applet GAME code used to push some partial (first-leg-only) moves with setlegal (because there was no way to include the side effect there), just to make sure that the destination would be highlighted and available for clicking. (After which it would use continuemove to inquire about the side effect.) But this backfires now, because the JavaScript thinks these moves would be legal by themselves, leaving ambiguity when there is in fact none after the second click, and needlessly asking for a third.

I have already brought up this problem and its solution with you, but you ignored what I said. If you would add a move option with pass as the second part of the move, the player could choose that immediately, which would bypass the need for the player to complete the move on the next page. If you like, you could even remove the option that includes the move by itself without pass. Then the player would have to make a choice before continuing to the next page.

If I can rely on highlighting in the future being purely done from $extralegal, I can refrain from writing anything to $legalmoves.

Using $legalmoves ensures that everything will be written in a standard format. If you use only $extralegal, you should keep your notation standardized. For a standard move, this means the piece notation, a space, the origin coordinate, a hyphen, and a destination coordinate with no extra spaces. For a drop, this means the piece notation, an asterisk, and the destination coordinate. For a free drop, just replace the asterisk with a hyphen. Note that if you use aliases, the piece notation is the alias, not the label used as a key in $pieces.

since you seem to synthesize the move texts from the square pairs given to setlegal, which you will have to do for backward compatibility, it might be better to extend the capabilities of setlegal to also accept multi-leg moves, so that there is a unified way to submit moves for highlighting.

I'll think about that, but first I have to work on what I mentioned at the top.