Comments/Ratings for a Single Item
Whether a piece can promote or not depends on its ranking in the piece list and the value of maxPromote. If you want a Pawn that cannot e.p. capture you just leave out the e mode. E.g. fmWfcF instead of fmWfceF.
HG, I meant directly in the game code. Remaking everything is not an option as the diagram designer cannot imitate partially. I'm trying to rewrite just the game code.
To add a new piece (say X / x) to the GAME-code generated by the Play-Test applet you would have to add its move definitions at the end of the legdefs array, and supply functions X and x that return where in the legdefs array you have done that. Determining the latter is a bit of a pain; there are comments in the legdefs table that in parentheses indicate where the definition for each piece type starts, and you can then count the numbers appearing after that. Note that because the 'bare Pawn' is an asymmetric piece you would need different definitions for the white and the black one.
The move definition of a (white) FIDE Pawn is:
1 1 0 1 1 1 1 1 1 2 1 1 -1 1 2 1 1 0 2 16577 // pawn(1) 1 1 1 1 4 1 1 -1 1 4 0
The first 3 lines would suffice for the Shatranj Pawn; each line starts with the number of legs (always 1 here, as Pawns only have simple moves), the forward and sideway step size, the 'range' (= number of times the step can be repeated) and finally a code to indicate what the move can do (2 = capture, 1 = non-capture, e.p. capture = 4) and other details (like whether it is a virgin-only move). So the 4th line is the double-push, the 5th and 6th are the e.p. captures. For your bare Pawn you would leave these lines out. The final 0 indicates that the definition ends there, and that the moves that follow (if any) are for another piece. The move specifications for a piece should always end with such a 0.
In the example I copied this from the white Pawn was the first piece, so it starts at element 1 of legdefs. The special moves of that Pawn start at element 16 (as the three normal moves each take 5 numbers to describe). That means that just behind legdefs there is a line
def P cond #0 1 16;
that tells the code that the move definitions of piece P start at 1 (normal moves) and 16 (special moves = moves having side effect, such as creation of e.p. rights, or disappearance of pieces elsewhere). For pieces without special moves the latter number should always be 0. So for the bare Pawn you would have to add a line there like
def X cond #0 ... 0;
where the ... is the location in legdefs where the move definition starts.
@HG, I had managed to do it despite some small setbacks. You know what's funny? This game also has berolina pawns!
I have also created dummy berolina pawns and made the trick for them, too!
6 comments displayed
Permalink to the exact comments currently displayed.
@HG,
I have asked you a question earlier on this post. May you take a look?