// 例題5 包囲ゲーム // rule.h ルール定義 #ifndef _RULE_H_ #define _RULE_H_ #define MAXRULE 10 // 方向関係 typedef enum { dir_none, dir_U, dir_D, dir_L, dir_R } Dir; Dir getdir(Point from, Point to); Point inter(Point from, Point to); bool isjump(Point from, Point to); bool isnext(Point from, Point to); // ルール型定義 typedef bool (*Rule)(const Move*,const Board*); // プロトタイプ宣言 bool rule_black_move1(const Move*,const Board*); bool rule_black_move2(const Move*,const Board*); bool rule_white_move1(const Move*,const Board*); bool check_rules(const Move *mp, const Board *bp); #define LIMIT 1 bool check_black_win(const Board *bp); bool check_white_win(const Board *bp); Winner check_winner(const Board*); void show_winner(Winner w); #endif