gochatai/pachi_py/pachi/montecarlo/montecarlo.c
/* FIXME: We cannot handle seki. Any good ideas are welcome. A possibility is
 * to consider 'pass' among the moves, but this seems tricky. */
We cannot handle seki. Any good ideas are welcome. A possibility is
to consider 'pass' among the moves, but this seems tricky.
We cannot handle seki . Any good ideas are welcome . A possibility is to consider ' pass ' among the moves but this seems tricky .
void
board_stats_print(struct board *board, struct move_stat *moves, FILE *f)
{
	fprintf(f, "\n       ");
	int x, y;
	char asdf[] = "ABCDEFGHJKLMNOPQRSTUVWXYZ";
	for (x = 1; x < board_size(board) - 1; x++)
		fprintf(f, "%c    ", asdf[x - 1]);
	fprintf(f, "\n   +-");
	for (x = 1; x < board_size(board) - 1; x++)
		fprintf(f, "-----");
	fprintf(f, "+\n");
	for (y = board_size(board) - 2; y >= 1; y--) {
		fprintf(f, "%2d | ", y);
		for (x = 1; x < board_size(board) - 1; x++)
			if (moves[y * board_size(board) + x].games)
				fprintf(f, "%0.2f ", (floating_t) moves[y * board_size(board) + x].wins / moves[y * board_size(board) + x].games);
			else
				fprintf(f, "---- ");
		fprintf(f, "| ");
		for (x = 1; x < board_size(board) - 1; x++)
			fprintf(f, "%4d ", moves[y * board_size(board) + x].games);
		fprintf(f, "|\n");
	}
	fprintf(f, "   +-");
	for (x = 1; x < board_size(board) - 1; x++)
		fprintf(f, "-----");
	fprintf(f, "+\n");
}
void board_stats_print ( struct board * board , struct move_stat * moves , FILE * f ) { fprintf ( f , " \n " ) ; int x , y ; char asdf [ ] = " " ; for ( x = 1 ; x < board_size ( board ) - 1 ; x ++ ) fprintf ( f , " " , asdf [ x - 1 ] ) ; fprintf ( f , " \n " ) ; for ( x = 1 ; x < board_size ( board ) - 1 ; x ++ ) fprintf ( f , " " ) ; fprintf ( f , " \n " ) ; for ( y = board_size ( board ) - 2 ; y >= 1 ; y -- ) { fprintf ( f , " " , y ) ; for ( x = 1 ; x < board_size ( board ) - 1 ; x ++ ) if ( moves [ y * board_size ( board ) + x ] . games ) fprintf ( f , " " , ( floating_t ) moves [ y * board_size ( board ) + x ] . wins / moves [ y * board_size ( board ) + x ] . games ) ; else fprintf ( f , " " ) ; fprintf ( f , " " ) ; for ( x = 1 ; x < board_size ( board ) - 1 ; x ++ ) fprintf ( f , " " , moves [ y * board_size ( board ) + x ] . games ) ; fprintf ( f , " \n " ) ; } fprintf ( f , " " ) ; for ( x = 1 ; x < board_size ( board ) - 1 ; x ++ ) fprintf ( f , " " ) ; fprintf ( f , " \n " ) ; }
FIXME: We cannot handle seki.
FIXME : We cannot handle seki .