H. G. Muller wrote on Fri, Oct 9, 2020 01:27 PM UTC:
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:
Click here to open/close a piece overview. Play it!
The AI will now respond to your moves! ( + 2.5 ply - )
Info for selected board piece
mc
Move or capture
mc
Move or capture (unblockable jump)
m
Move only
im
Move only (unmoved piece only)
c
Capture only
ca
Locust capture (hover/touch for sequel)
O
Castling destination of King
m,c
Forbidden move, but delivers check
Click on piece to toggle its moved status
Click on piece name to see its move diagram. (print version)
ID
white
nr
black
nr
name
move
P
-
-
pawn
ifmnDfmWfceamfF
N
-
-
knight
mNcafsmK
B
-
-
bishop
mBcafmB
R
-
-
rook
mRcafmR
Q
-
-
queen
mQcafmQ
K
-
-
king
mKcafmKisjO2
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.
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:
Interactive diagram: pieces movable, right-click resets!
Click here to open/close a piece overview. Play it!
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.