Add WIP on the playable shots list displaying
[Project_algorithmic_C.git] / lib / othello.c
index 5d9970c6941a0942d8e948a90541a0a55a06fdbd..4f1b83ec52cd1b8cda16f1696b85c56a9e499b4b 100644 (file)
@@ -253,3 +253,34 @@ unsigned int valid_shot(int y, int x, unsigned int current_player, unsigned int
     set_pawn(y, x, current_player, pawn_array);
     return nb_pawns_reversed;
 }
+
+struct shots_list_s build_playable_shots_list(int y, int x, unsigned int current_player, unsigned int pawn_array[board_size][board_size]) {
+
+    for (unsigned int i = 0; i <= board_size; i++) {
+        for (unsigned int j = 0; j <= board_size; j++) {
+            if (is_legal_shot(y, x, current_player, pawn_array)) {
+
+            }
+        }
+    }
+}
+
+void create_shots_list_cell(struct shots_list_s* shots_list_cell) {
+
+}
+
+static void set_shots_list_coordinates(int y, int x, struct shots_list_s* shots_list) {
+
+    if (is_valid_coordinates(y, x)) {
+        shots_list->y = y;
+        shots_list->x = x;
+    }
+}
+
+void set_shots_lists_cell(int y, int x, unsigned int type, struct shots_list_s* shots_list) {
+
+    if (type > 0 && type < 5) {
+        set_shots_list_coordinates(y, x, shots_list);
+        shots_list->type = type;
+    }
+}