Implement :
[Project_algorithmic_C.git] / lib / othello.h
index 628f8e1c1a3a706c62d48b65777e0aefb332a5cb..a591405db2563216aba4452a265b9d895fdc9801 100644 (file)
 #define OTHELLO_H
 
 #include "constants.h"
-
-/* FIXME: declare and initialize the array here */
-//unsigned int pawns[board_size][board_size];
+#include "list.h"
+
+/* TODO: must be used to replace the explicit pawns 2D array */
+struct pawns_s {
+    unsigned int pawns[board_size][board_size];
+};
+
+/* linked list of played shots */
+struct shots_history_list_s {
+    struct list_head list;
+    unsigned int*** pawn_array_member; /* pointer to a cell of the pawns 2D array */
+    /* struct* pawns_s pawn */
+};
+
+/* linked list of can play shots */
+struct shots_exploration_s {
+    struct list_head list;
+    int y;
+    int x;
+    unsigned int type;
+};
 
 unsigned int current_player(unsigned int round_count);
+unsigned int eval_winner(unsigned int nb_white, unsigned int nb_black);
 
 int** init_pawns(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);
 unsigned int get_box_value(int y, int x, unsigned int pawn_array[board_size][board_size]);
 int** set_pawn(int y, int x, unsigned int type, unsigned int pawn_array[board_size][board_size]);
 
+bool is_valid_input(int y, int x, 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_board_full(unsigned int pawn_array[board_size][board_size]);
+
 unsigned int count_pawn_type(unsigned int pawn_array[board_size][board_size], unsigned int type);
 
 #endif /* OTHELLO_H */