Finish implementation of Shogi
[capablanca.git] / lasker-2.2.3 / src / algcheck.c
index d043445..c7b6906 100644 (file)
@@ -656,8 +656,8 @@ char *alg_unparse(struct game_state_t * gs, struct move_t * mt)
   }\r
   sprintf(tmp, "%c%d", mt->toFile + 'a', mt->toRank + 1 - (gs->ranks > 9));\r
   strcat(mStr, tmp);\r
-\r
-  if ((piece == PAWN) && (mt->piecePromotionTo != NOPIECE)) {\r
+
+  if ((piece == PAWN || gs->promoType == 3) && (mt->piecePromotionTo != NOPIECE)) {\r
     strcat(mStr, "=");         /* = before promoting piece */\r
     switch (piecetype(mt->piecePromotionTo)) {\r
     case KNIGHT:\r
@@ -702,6 +702,15 @@ char *alg_unparse(struct game_state_t * gs, struct move_t * mt)
     case MASTODON:\r
       strcat(mStr, "G");\r
       break;\r
+    case GOLD: // [HGM] Shogi promotions: avoid use of '+'\r
+      strcat(mStr, "G");\r
+      break;\r
+    case DRAGONHORSE:\r
+      strcat(mStr, "I");\r
+      break;\r
+    case DRAGONKING:\r
+      strcat(mStr, "J");\r
+      break;\r
     default:\r
       break;\r
     }\r