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

GAME code table-driven move generator[Subject Thread] [Add Response]
H. G. Muller wrote on Tue, Aug 11, 2020 09:33 PM UTC in reply to Fergus Duniho from 08:45 PM:

I have created an $extralegal variable for additional legal moves.

Well, very nice, but you did not mention it that it would be available in the JavaScript, as legalMoves is. You only mentioned the HTML drop-down. That there will be a JavaScript array legalList is (good) news. Provided it will be accompanied by the JavaScript code to do something useful with it.

In fact the only thing that is still missing in the Applet-generated preset automation is that the highlights in the continuemove screen do not switch on automatically, but that you have to click the piece you just moved for that. That you can switch those on at all is the advantage of presenting the freedrops and suicide to setlegal as fake moves of the piece moved in the previous leg: the standard highlighting code will then provide you a handle to switch on the highlights on all the mentioned destination square. That this finally submits the wrong move can be corrected in the GAME code.

Main remaining defect of the current code is that aliasing piece names breaks the promotion code, because capturedpieces does not contain aliases.

Some irregularities I noticed:

If the last statement in the Pre-Game code has a comment behind it, it totally confuses the GAME-code parser, which starts complaining that the scope goes negative. At least, I think that was the reason. When I removed the comment, the same code worked without problem.

And often I have to save changes twice before they are actually used in Play or Move mode, even though they are saved the first time.