1 #ifndef ZZGO_PATTERN3_H
2 #define ZZGO_PATTERN3_H
4 /* Fast matching of simple 3x3 patterns. */
6 /* (Note that this is completely independent from the general pattern
7 * matching infrastructure in pattern.[ch]. This is fast and simple.) */
13 /* Hashtable: 2*8 bits (ignore middle point, 2 bits per intersection) */
14 /* Value: 0: no pattern, 1: black pattern,
15 * 2: white pattern, 3: both patterns */
19 /* Source pattern encoding:
20 * X: black; O: white; .: empty; #: edge
21 * x: !black; o: !white; ?: any
23 * extra X: pattern valid only for one side;
24 * middle point ignored. */
26 void pattern3s_init(struct pattern3s
*p
, char src
[][11], int src_n
);
28 bool test_pattern3_here(struct pattern3s
*p
, struct board
*b
, struct move
*m
);