piece ID NAME MOVESPEC
for example
piece A Archbishop BN
piece C Colonel FfsRbWfhN
piece Berolina_Pawn fmFfcW=Q,R,B,N
piece H Horse W-F
piece C Cannon mRpR-cR
piece G Grasshopper pQ-K
piece L Lance fR=+L
piece +L Gold WfF
piece W Contact_Withdrawer otmcK-bK-mQ
piece F Rifle_Withdrawer otcQ-ebQ-mQ
So the ID would be the letter that tells the GUI which piece of the FEN describing the initial position this refers to. Then follows a name, which can be used in menus for selecting promotion piece, setting up positions, etc. Finally the way the piece moves is described in extended Betza notation.
This would allow the GUI to play variants with arbitrary pieces; all the engine has to do is send a piece command for every piece the variant uses. The MOVESPEC would also contain information about possible promotion choices for the piece.
The extended Betza notation would allow specification of multi-leg moves, and has the following syntax:
<spec> := <path> | <path> <spec>
<path> := <slide> | <slide> - <path>
<slide> := <leg> | <leg> <dressed exponent>
<leg> := <modifiers> <atom>
<modifiers> := <special effects> <directionset> <modality>
<atom> := ( <spec> ) | <shotcut> | W | F | D | N | A | H | L | J | G
<shortcut> := K | Q | R | B
<directionset> := <direction> <directionset> | <direction>
<direction> := l | r | f | b | v | s | h | a | <empty>
<modality> := <action> | <action> <modality>
<action> := m | c | d | p | t | u | o | <empty>
<special effects> := <effect> | <effect> <special effects>
<effect> := x | e | i | <empty>
<dressed exponent> := <modifiers> <number>
<empty> :=
The atoms refer to sets of symmetry-equivalent moves of a certain length. The modifiers specify what these steps can do (modality), and optionally select a subset of directions from it (e.g. to support asymmetric pieces). The meaning of the directions is reasonably intuitive, if you realize that v (vertical) is a shortcut for fb = f or b, and s (sideway) a shortcut for lr = l or r.
The modality is more tricky; for legs of a multi-leg moves there are many possibilities, as the old occupant of the visited square doesn't have to be captured if you plan to move on. The meaning is the following:
Code: Select all
c (capture) replace foe, and 'carry him off'
m (move) to empty square
d (destroy) replace friend, and carry him off
p (hop) non-destructive passing through occupied square
t (test) non-destructive passing through friendly square
u (unload) swap what you are carrying with occupant or empty
o (off) temporarily step off-board
Together these possible actions can specify moves that implement a wide variety of side effect. You can for instance specify side-effect captures by a multi-leg move that visits the squares to capture as intermediates. E.g. a Checker does one forward diagonal step to capture, and then mandatorily continues with s second step to move: fcF-fmF, where F is the 1-step diagonal atom. (The second 'f' is referred to the previousstep, i.e. 'forward' always means 'continue in the same direction'.)
Rifle captures can be done by capturing in the normal Chess way, and then in a second leg move back by an equal amount. A Rifle Rook would be mRcR-ebR, the mR part describing its non-capture moves, the cR-ebR the captures mandatorily followed by an equal (=e) Rook step in the opposite (=b) direction, to end where you started.
Moves like castling (or catapult pieces) can be written by first capturing (or destroying, depending on who owns it) the piece you want to displace as a side effect, and with the unload operation you can then carry it elsewhere, before going to your own destination. E.g. Q-side castling could be specified on a Rook by latting it first capture its own King on e1, then carry it to c1, and finally move to d1: irdiW04-buW02-bmW. Here the i modifier means 'initial', i.e. for virgin piece only, the first leg is exactly 4 rW steps (04 means exactly, 4 woud mean 1-4) to pick up the virgin King, then double-back exactly 2 W steps to offload that King, and reverse direction again to move end up on d1.
x is an explosion operator, allowing multiple alternative realizations of a move spec to be all executed in parallel (i.e. capture stuff in all 8 directions, as in Atomic Chess, would be an -xacdK final leg piggy-backed on all capture moves).