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 ]

Comments/Ratings for a Single Item

EarliestEarlier Reverse Order Later
New Grand Apothecary Chess Error.[Subject Thread] [Add Response]
Aurelian Florea wrote on Wed, May 4, 2022 06:32 PM UTC in reply to Aurelian Florea from Fri Apr 22 06:56 AM:

@HG,

I have asked you a question earlier on this post. May you take a look?


H. G. Muller wrote on Wed, May 4, 2022 09:06 PM UTC:

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.


Aurelian Florea wrote on Thu, May 12, 2022 08:46 AM UTC in reply to H. G. Muller from Wed May 4 09:06 PM:

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.


H. G. Muller wrote on Thu, May 12, 2022 09:43 AM UTC in reply to Aurelian Florea from 08:46 AM:

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.


Aurelian Florea wrote on Thu, May 12, 2022 07:23 PM UTC in reply to H. G. Muller from 09:43 AM:

@HG, I had managed to do it despite some small setbacks. You know what's funny? This game also has berolina pawns!


Aurelian Florea wrote on Fri, May 13, 2022 12:20 PM UTC in reply to Aurelian Florea from Thu May 12 07:23 PM:

I have also created dummy berolina pawns and made the trick for them, too!


6 comments displayed

EarliestEarlier Reverse Order Later

Permalink to the exact comments currently displayed.