XBoard 4.9 (or rather, a recent checkout from winboard.nl with a few patches to make Xiangqi work properly) hangs if I send "choice" in response to "lift". The log file is rather unhelpful, all it contains is this:
The relevant position is [D]rn1qkbnr/p1ppppP1/bp6/7p/4P3/8/PPPP2PP/RNBQKBNR w KQkq - 1 6
(In case anyone wonders: I'm testing a random-mover mode)
All I can do after picking up the pawn is kill xboard (using ctrl-C in the terminal), it does not respond to key presses or mouse clicks. It looks like it's stuck in a loop somewhere...
Sorry, I was a bit distracted by the ICGA Olympiad the past week. Can you try it with captital piece IDs, as the specs of the 'choice' command prescribe? XBoard probably gets stuck in a cyclic loop through the pieceToCharTable if it cannot find a match with the string in the 'choice' command.
The engine-intf.html in the source tar ball describes it. Apparently the one on the GNU website has not been updated yet to conform to the latest release.
And indeed, the first piece mentioned will be the default piece. Also notice the use of blue highlights to trigger promotion without choice.
hgm wrote:Sorry, I accidentally damaged your previous post, by hitting 'Edit' where I thought I was hitting 'Quote'.
Moderator abuse! Bring out the pitchforks! Get the tar and feathers! I'm being oppressed!
Ahem.
Anyway, the point was, it works now.
And indeed, the first piece mentioned will be the default piece. Also notice the use of blue highlights to trigger promotion without choice.
I have the blue highlights.
I gather the rest of the order is arbitrary? I now send the pieces in order (from most valued to least valued), so I get Q by default. However, N is still second, although I send the string as QRBN... doesn't matter too much, as long as the first choice makes sense.
Indeed, XBoard cycles through the pieces in pieceToCharTable order, usually starting at Queen, except for some variants that explicitly specify a different default. It always skips pieces for which no ID is defined. So it is no problem if the Queen does not participate. In Chess there is nothing after Q, so it immediately wraps to N.
The 'choice' command only alters this procedure by also skipping every piece not in the choice string, and starting at the first-mentioned piece.
(When the piece to promote is part of a Shogi-promotion pair, i.e. if it or its partner has a '+' defined as ID for it, a different procedure is used, which just alternates between the promoted and unpromoted version.)