[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]
Check out Janggi (Korean Chess), our featured variant for December, 2024.
Check out Janggi (Korean Chess), our featured variant for December, 2024.
Well, the idea was of course to let the GAME-code wizard do most of the work, starting from an Interactive Diagram made through the Play-Test Applet. It took a few minutes to create this with the Applet:
which does take care of the piece moves. (But not of the zonal confinement / mandatory capture.) Which has one defect, though: the e.p. capture does not work when specified on a non-final leg. At least in the move generator used for highlighting, the AI could be more accurate. I recall encountering this issue many times during programming the stuff, and each time I thought "a locust e.p. capture? Nah, that will never be needed." Obviously I was wrong. So I might have to shape up the move generator here and there, also the one I wrote in GAME code. The move tables the Betza compiler generates for this are OK, but the code that interprets them unjustly assumes an e.p. leg always is the last leg of the move.
Enforcing the rule that non-captures cannot go to an edge in the GAME code is pretty trivial; the mandatory capture is more tricky, though. In particular in combination with legal-move highlighting. I guess it would be useful to extend the move generator in the GAME-code include file with a task that would test whether there exists a legal or a pseudo-legal capture, very similar to how it checks whether there exists a legal move. Perhaps the existing code can be used for that, by introduction of a global flag that tells it to ignore non-captures. The Post-Move code for the latest move of the game could then start calling the move generator for this task for all pieces on the edge, if the move in question was a non-capture or did not start from the edge. Existence of a capture from the edge would then make the move illegal. In other cases the mandatory-capture requirement is fulfilled, and the standard procedure (which doesn't take it into account) can be called.
BTW, the Diagram's AI does think the Knight is worth more than a Bishop. For each capture target the Knight also has two possible final squares.