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]);
}