Check out Smess, our featured variant for February, 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]
H. G. Muller wrote on Sat, Aug 22, 2020 06:50 AM UTC in reply to Fergus Duniho from 01:49 AM:

I will delay removing them until tommorow, since H.G. currently has code that is using them.

OK, thanks, I have grabbed them now from movepiece.js so I can put them in an adapted script if needed.

I tried the new JavaScript in Mighty Lion. If the Lion captures an adjacent Pawn (l d6-e5) by clicking the latter twice, the move is submitted, but the Post-Move code does ask for a second leg because no pass was appended. Based on the reasoning in the previous comment, this should be considered as a flaw of the Post-Move code, though; it should just have accepted the move. Then this would have worked fine.

More serious is that when I try to play a distant Lion move beyond the Pawn (e.g. l d6-e4) it does not immediately accept the move, but still wants me to choose between the simple move and "l d6-e5; l e5-e4", highlighting both e4 and e5 to make that choice. This is a consequence of the "any order" policy, rather than using the order of entry of clicks 2 and 3 to distinguish between the shooter and the multi-mover case. Highlighting e4 and e5 here would have been desirable for the Forest Ox (a shooter, which would have indicated that by specifying the move as "l d6-e4; @-e5", requesting click order d6-e4-e5). The Lion is a multi-mover, though, and should have required d6-e5-e4 for taking the Pawn, while d6-e4 should already have been an unambiguous expression of the desire to not take the Pawn.

For me that issue is still important enough to prefer my own adaptation of the JavaScript. In connection with that I have some questions:

  • Currently the JavaScript array legalMoves[] is still on the Game Courier pages, and my adapted version, as well as some JavaScript embedded in the page that decides what the "How to move pieces" section should say still test for its presence. But since the new movepiece.js does not refer to it at all, I suppose it is scheduled for removal. Is it safe to assume that all future scripts will define legalList as null for presets that do not show legal moves, and that I should test that?
  • Would it be possible for an editor to rename the file /membergraphics/MSgame-code-generation/movepiece.txt to movepiece.js? Once the name exist I will be able to update it in the normal way. Then I could make presets that want to use it just contain the link to that file. As it is I would have to put the entire script in the page itself. And these are non-cached pages, typically loaded many times during a game.
  • A minor inconvenience is that the text editor for the 'Rules, written in HTML' field in the Edit screen for presets starts in WYSIWYG mode, which strips the HTML of any existing content of that section from everything it doesn't know, in particular script tags, before you even get a chance to see it. If it would start in 'Source Code' mode, as it does in the submission for for member-contributed articles, the original content would be respected, and people that do not want to use any special HTML there can still easily switch to to WYSIWYG. I do like that text editor very much; even in source-code mode it is very helpful in indenting HTML tags and JavaScript, pointing out imbalanced tags and such. But that switching to WYSIWYG mode can lose you so much source definitely is a risky feature of it.