board_stone_radar(): Move to tactics.*
[pachi.git] / tactics.h
blob3c70422787780e55a122b0e942b4b65777df45e3
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);
15 /* Checks if there are any stones in n-vincinity of coord. */
16 bool board_stone_radar(struct board *b, coord_t coord, int distance);
19 bool is_bad_selfatari_slow(struct board *b, enum stone color, coord_t to);
20 static inline bool
21 is_bad_selfatari(struct board *b, enum stone color, coord_t to)
23 /* More than one immediate liberty, thumbs up! */
24 if (immediate_liberty_count(b, to) > 1)
25 return false;
27 return is_bad_selfatari_slow(b, color, to);
30 #endif