gochatai/pachi_py/pachi/gtp.c
/* XXX Completely unsafe if reply buffer is not big enough */
XXX Completely unsafe if reply buffer is not big enough
XXX Completely unsafe if reply buffer is not big enough
static void
gogui_owner_map(struct board *b, struct engine *engine, char *reply)
{
	char str2[32];
	reply[0] = 0;
	if (!engine->owner_map)
		return;
	sprintf(reply, "INFLUENCE");
	foreach_point(b) {
		if (board_at(b, c) == S_OFFBOARD)
			continue;
		float p = engine->owner_map(engine, b, c);
		if (p < -.8)
			p = -1.0;
		else if (p < -.5)
			p = -0.7;
		else if (p < -.2)
			p = -0.4;
		else if (p < 0.2)
			p = 0.0;
		else if (p < 0.5)
			p = 0.4;
		else if (p < 0.8)
			p = 0.7;
		else
			p = 1.0;
		sprintf(str2, " %3s %.1lf", coord2sstr(c, b), p);
		strcat(reply, str2);
	} foreach_point_end;
	strcat(reply, "\nTEXT Score Est: ");
	gtp_final_score(b, engine, str2, sizeof(str2));
	strcat(reply, str2);
}
static void gogui_owner_map ( struct board * b , struct engine * engine , char * reply ) { char str2 [ 32 ] ; reply [ 0 ] = 0 ; if ( ! engine -> owner_map ) return ; sprintf ( reply , " " ) ; foreach_point ( b ) { if ( board_at ( b , c ) == S_OFFBOARD ) continue ; float p = engine -> owner_map ( engine , b , c ) ; if ( p < -.8 ) p = -1.0 ; else if ( p < -.5 ) p = -0.7 ; else if ( p < -.2 ) p = -0.4 ; else if ( p < 0.2 ) p = 0.0 ; else if ( p < 0.5 ) p = 0.4 ; else if ( p < 0.8 ) p = 0.7 ; else p = 1.0 ; sprintf ( str2 , " " , coord2sstr ( c , b ) , p ) ; strcat ( reply , str2 ) ; } foreach_point_end ; strcat ( reply , " \n " ) ; gtp_final_score ( b , engine , str2 , sizeof ( str2 ) ) ; strcat ( reply , str2 ) ; }
XXX Completely unsafe if reply buffer is not big enough
XXX Completely unsafe if reply buffer is not big enough
// p = -1 for WHITE, 1 for BLACK absolute ownership of point i                                      