X-Git-Url: https://git.piment-noir.org/?p=Project_algorithmic_C.git;a=blobdiff_plain;f=lib%2Fothello.c;h=4f1b83ec52cd1b8cda16f1696b85c56a9e499b4b;hp=5d9970c6941a0942d8e948a90541a0a55a06fdbd;hb=7aab9e03ce0779a461044f56bc3f478e1c8d2460;hpb=6d7fa659380189a35b8d7cce9f0417b4ed1ce3a5 diff --git a/lib/othello.c b/lib/othello.c index 5d9970c..4f1b83e 100644 --- a/lib/othello.c +++ b/lib/othello.c @@ -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; + } +}