8 #include "joseki/base.h"
11 struct joseki joseki_pats
[1 << joseki_hash_bits
];
16 FILE *f
= fopen("pachijoseki.dat", "r");
20 while (fgets(linebuf
, 1024, f
)) {
23 hash_t h
= strtoull(line
, &line
, 16);
24 while (isspace(*line
)) line
++;
25 enum stone color
= *line
++ == 'b' ? S_BLACK
: S_WHITE
;
26 while (isspace(*line
)) line
++;
29 char *cs
= strrchr(line
, ' '); assert(cs
);
33 coord_t
**ccp
= &joseki_pats
[h
].moves
[color
- 1];
35 *ccp
= calloc2(count
+ 1, sizeof(coord_t
));
38 assert(cc
- *ccp
< count
);
39 coord_t
*c
= str2coord(line
, 21 /* XXX */);
42 line
+= strcspn(line
, " ");
43 line
+= strspn(line
, " ");