Name
golist -- auxiliary functions
Details
str_to_int ()
int str_to_int (const char *str,
int def); |
str_to_double ()
double str_to_double (const char *str,
double def); |
rank_to_strength ()
gboolean rank_to_strength (const char *rank,
double *strength_ptr); |
Convert a rank string of the form "3d" or "5k" into a numerical
strength value. rank must be an integer number x, followed
by either d (for dan grades) or k (for kyu grades).
The computed strength value is x-1 for "x dan" or -x for "x kyu".
rank may be NULL or the empty string. In this case
the strength value -100 (meaning "unknown strength") is returned.
snprint_strength ()
void snprint_strength (char *str,
size_t size,
double strength); |
Prints the rank, which is closest to strength into str.
This is the inverse operation to rank_to_strength().