X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book.c;h=8b4a43c2d7fedb65774c10145e6ff1b5b751dcc5;hb=143a5473aa9fae9804a781575f4652dcf89f0bbb;hp=8872d16987d3a26a148b3a70725f4deaa537549d;hpb=4d42db95528089b0a3af8828893524cea281627e;p=xboard.git diff --git a/book.c b/book.c index 8872d16..8b4a43c 100644 --- a/book.c +++ b/book.c @@ -502,11 +502,19 @@ move_to_string (char move_s[6], uint16 move) move_s[2] = tf + 'a'; move_s[3] = tr + '1' - (BOARD_HEIGHT > 9); + if(IS_SHOGI(gameInfo.variant) && p) { + if(p == 2) p = 10; // Lion moves, for boards so big that 10 is out of range + else if(p != 7) p = 8; // use '+' for all others that do not explicitly defer + } + // kludge: encode drops as special promotion code if(gameInfo.holdingsSize && p == 9) { move_s[0] = f + '@'; // from square encodes piece type move_s[1] = '@'; // drop symbol p = 0; + } else if(p == 10) { // decode Lion move + + p = 0; } // add promotion piece, if any @@ -716,7 +724,7 @@ char * MovesToText(int count, entry_t *entries) { int i, totalWeight = 0; - char algMove[6]; + char algMove[12]; char *p = (char*) malloc(40*count+1); for(i=0; i