Yes.myfish wrote:Actually, it seems 'I' may have misunderstood the way the variants are done.
Code: Select all
game->add_piece_type( fk, fk, kf, pz, "", "Phoenix", "K,k", "K"); game->add_piece_type( ff, ff, 0, pp, "+", "Falcon", "F,f", "F"); game->add_piece_type( fc, fc, 0, pz, "", "Crane", "C,c", "C"); game->add_piece_type(flq, flq, 0, pz, "", "Left quail", "L,l", "L"); game->add_piece_type(frq, frq, 0, pz, "", "Right quail","R,r", "R"); game->add_piece_type( fp, fp, 0, pz, "", "Pheasant", "P,p", "P"); game->add_piece_type( fs, fs, pf, pp, "+", "Swallow", "S,s", "S"); game->add_piece_type( fg, fg, 0, pz, "", "Goose", "+S,+s","+S"); game->add_piece_type( fe, fe, 0, pz, "", "Eagle", "+F,+f","+F"); game->start_fen = strdup("rpckcpl/3f3/sssssss/2s1S2/SSSSSSS/3F3/LPCKCPR [-] w 0 1"); game->xb_setup = strdup("(S.....FLR.C+.....+.PKs.....flr.c+.....+.pk) 7x7+6_shogi");
From variants.h
Are we saying we can define ANY single letter code to correspond to the Xboard FEN?
However, you'll notice that there are three distinct names for each piece: what white pieces are called in position (FEN) strings, what black pieces are called there (typically the lower-case version of the white character) and what symbol should be used for SAN output of moves (typically the same as the white piece name, but pawn-likes are typically an exception). The latter is also used to identify the piece type by promotion.
I think SjaakII will work correctly if you use more than one character for the piece name (as it appears in SAN output), at least as long as nothing promotes to this piece type. It will not work correctly if the white/black identifiers in position strings are not single characters. Certainly none of the code was written with piece-IDs longer than a single character in mind.In Yari, we have Yari Bishop, Yari Rook and just Rook for example so you couldn't use R for rook, nor Y for Yari. Thinking about dai and chu etc 2 piece naming for pgn etc would open the doors but I'm no programmer and this would likely break everything right. But surely, lets take the Tori example.
L = Left Quail. I want to see LQ in the pgn and move list. So why can't we just assign LQ to the variable 'L' or isn't it that simple ?
There are two exceptions to this: the first character may be "+" to indicate this is the promoted version of some other piece type, or the second character may be "~" to indicate that this piece type demotes when captured (what it demotes to is not specified, but reconstructed from the promotion rules).
In general it is quite hard to describe positions with mixed single/double character piece identifiers. Imagine a variant that has a Left Quail (LQ), a Lance (L) and a Queen (Q). Or worse, a Phoenix (Ph), a Pawn (P ) and a Horse (H): is "Ph" a phoenix, or a white pawn next to a black horse?
HGM is better equipped to discuss the issues there than I am though.
For variants with many different piece types, it's no longer simply a matter of cosmetics: if there are more than 26 piece types, you need to resort to something other than single character identifiers for pieces. For SjaakII that's not going to be an issue, since it can't handle more than 16 piece types per variant (not sure if I documented that limitation; I probably should).
