is_bad_selfatari(): Move to new file tactics.*
[pachi.git] / tactics.h
blobce0d4142f138cac60dd1f227c638bb47d865d487
1 #ifndef ZZGO_TACTICS_H
2 #define ZZGO_TACTICS_H
4 /* Advanced tactical checks non-essential to the board implementation. */
6 #include "board.h"
8 /* Check if this move is undesirable self-atari (resulting group would have
9 * only single liberty and not capture anything; ko is allowed); we mostly
10 * want to avoid these moves. The function actually does a rather elaborate
11 * tactical check, allowing self-atari moves that are nakade, eye falsification
12 * or throw-ins. */
13 static bool is_bad_selfatari(struct board *b, enum stone color, coord_t to);
16 bool is_bad_selfatari_slow(struct board *b, enum stone color, coord_t to);
17 static inline bool
18 is_bad_selfatari(struct board *b, enum stone color, coord_t to)
20 /* More than one immediate liberty, thumbs up! */
21 if (immediate_liberty_count(b, to) > 1)
22 return false;
24 return is_bad_selfatari_slow(b, color, to);
27 #endif