X-Git-Url: http://winboard.nl/cgi-bin?p=capablanca.git;a=blobdiff_plain;f=lasker-2.2.3%2Fsrc%2Fgameproc.c;h=52f42e2d7ebde1da964dfbc5ae137c862da452e7;hp=8398499479b657535dd2d6959dcb1c16b3e0121c;hb=ec7b6bb32ba9632cda17b308808ce9ba1e27c090;hpb=0718fef115e9a5dcf8e60c1be2915b4ecabfff27 diff --git a/lasker-2.2.3/src/gameproc.c b/lasker-2.2.3/src/gameproc.c index 8398499..52f42e2 100644 --- a/lasker-2.2.3/src/gameproc.c +++ b/lasker-2.2.3/src/gameproc.c @@ -434,6 +434,18 @@ static int was_promoted(struct game *g, int f, int r) return 0; } +static int is_virgin(struct game *g, int f, int r) +{ + int i; + + for (i = g->numHalfMoves-2; i > 0; i -= 2) { + if (g->moveList[i].toFile == f && g->moveList[i].toRank == r) { + return 0; + } + } + return 1; +} + int pIsPlaying (int p) { struct player *pp = &player_globals.parray[p]; @@ -561,7 +573,7 @@ void process_move(int p, char *command) } pp->promote = NOPIECE; // [HGM] this seemed to be uninitialized, which caused spurious promotion in Shogi if ((len = strlen(command)) > 1) { - if (command[len - 2] == '=') { + if (command[len - 2] == '=' || gg->gameState.drops == 2 && command[len - 2] == '/') { // [HGM] encode gating as promotion printf("promo '%s'\n", command); switch (tolower(command[strlen(command) - 1])) { case 'n': @@ -609,6 +621,12 @@ printf("promo '%s'\n", command); pp->promote = MASTODON; break; // Shogi promotions + case 'h': + pp->promote = DRAGONHORSE; + break; + case 'd': + pp->promote = DRAGONKING; + break; case '^': case '+': pp->promote = GOLD; @@ -890,13 +908,14 @@ static int CheckRepetition (int p, int g) if (game_globals.garray[g].numHalfMoves < 8) /* can't have three repeats any quicker. */ return 0; - for (move_num = game_globals.garray[g].game_state.lastIrreversable; + for (move_num = game_globals.garray[g].game_state.lastIrreversable - 1; // [HGM] FEN stored in moveList[numHalfMoves-1] ! move_num < game_globals.garray[g].numHalfMoves - 1; move_num++) { pos = GetFENpos (g, move_num); if (strlen(pos1) == strlen(pos) && !strcmp(pos1, pos)) flag1++; if (strlen(pos2) == strlen(pos) && !strcmp(pos2, pos)) flag2++; +printf("%2d. %d-%d %s %s %s\n", move_num, flag1, flag2, pos1,pos2,pos); } if (flag1 >= 3 || flag2 >= 3) { if ((pend = find_pend(pp->opponent, p, PEND_DRAW)) != NULL) {