/* linked list of can play shots */
struct shots_list_s {
struct list_head list;
- int y;
- int x;
+ unsigned int y;
+ unsigned int x;
unsigned int type; /* can be white or black or hint allowed or hint_fordidden */
};
void zero_pawns(unsigned int pawn_array[board_size][board_size]);
void init_pawns(unsigned int pawn_array[board_size][board_size]);
-unsigned int get_box_value(int y, int x, unsigned int pawn_array[board_size][board_size]);
-void set_pawn(int y, int x, unsigned int type, unsigned int pawn_array[board_size][board_size]);
+unsigned int get_box_value(unsigned int y, unsigned int x, unsigned int pawn_array[board_size][board_size]);
+void set_pawn(unsigned int y, unsigned int x, unsigned int type, unsigned int pawn_array[board_size][board_size]);
-bool is_box_type(int y, int x, unsigned int pawn_array[board_size][board_size], unsigned int type);
+bool is_box_type(unsigned int y, unsigned int x, unsigned int pawn_array[board_size][board_size], unsigned int type);
bool is_board_full(unsigned int pawn_array[board_size][board_size]);
unsigned int count_pawns_type(unsigned int pawn_array[board_size][board_size], unsigned int type);
-unsigned int valid_shot(int y, int x, unsigned int current_player, unsigned int pawn_array[board_size][board_size]);
+bool is_legal_shot(unsigned int y, unsigned int x, unsigned int current_player, unsigned int pawn_array[board_size][board_size]);
+unsigned int valid_shot(unsigned int y, unsigned int x, unsigned int current_player, unsigned int pawn_array[board_size][board_size]);
+
+void build_playable_shots_list(unsigned int current_player, struct shots_list_s* shots_list, unsigned int pawn_array[board_size][board_size]);
+void free_shots_list(struct shots_list_s* shots_list);
#endif /* OTHELLO_H */