9 /* The S_OFFBOARD margin is not addressable by coordinates. */
11 static char asdf
[] = "abcdefghjklmnopqrstuvwxyz";
18 return strdup("pass");
19 } else if (is_resign(c
)) {
20 return strdup("resign");
22 /* Some GTP servers are broken and won't grok lowercase coords */
23 snprintf(b
, 4, "%c%d", toupper(asdf
[coord_x(c
) - 1]), coord_y(c
));
28 /* No sanity checking */
30 str2coord(char *str
, int size
)
32 if (!strcasecmp(str
, "pass")) {
34 } else if (!strcasecmp(str
, "resign")) {
35 return coord_resign();
37 char xc
= tolower(str
[0]);
38 return coord_init(xc
- 'a' - (xc
> 'i') + 1, atoi(str
+ 1), size
);