Out( "\nSearch a move to ponder\n\n" );
OutCsaShogi( "info ponder start\n" );
+#if defined(XBOARD)
+ // [HGM] for converting to CSA move during ponder
+ for( iret = 0; iret < nsquare; iret++ ) root_pos[iret] = BOARD[iret];
+#endif
+
game_status |= flag_puzzling;
iret = iterate( ptree );
game_status &= ~flag_puzzling;
int myTime, hisTime, movesPerSession, inc, plyNr;
char xboard_mode;
+int root_pos[nsquare];
int
xboard_to_CSA( tree_t * restrict ptree, char *in, char *out, int status )
int flag = (promo == '+' ? FLAG_PROMO : 0);
piece = abs( BOARD[from] ); // this only works when not searching!
printf("# piece from board: %d\n", piece);fflush(stdout);
- if( status & ( flag_pondering | flag_puzzling | flag_thinking ) ) {
+ if( status & flag_thinking ) {
int i, to = ('9' - toY)*9 + (toX - 'a'), l = (status == (flag_pondering | flag_thinking));
piece = 0; // kludge to force illegal CSA move
for( i = 0; l ? all_moves[i] : i < root_nmove; i++ ) { // determine the piece from the move list
bonanza_move = move;
break;
}
+ } else if( status & ( flag_pondering | flag_puzzling ) ) piece = abs( root_pos[from] ); // we have valid copy!
printf("# piece corrected to %d\n", piece);fflush(stdout);
- }
if( promo ) piece += promote;
sprintf(out, "%c%c%c%c%s", 'a'+'9'-fromX, '1'+'9'-fromY, 'a'+'9'-toX, '1'+'9'-toY, astr_table_piece[piece]);
}
extern const char ach_turn[2];
extern const unsigned char aifile[ nsquare ];
extern const unsigned char airank[ nsquare ];
+extern int root_pos[]; // [HGM] remembers root position during pondering
extern int move_list[], move_ptr; // [HGM] undo: game history (used in proce.c and makemove.c)
extern char analyze_mode; // [HGM] exclude: used in proce.c and root.c