X-Git-Url: https://git.piment-noir.org/?p=Project_algorithmic_C.git;a=blobdiff_plain;f=lib%2Fui.c;fp=lib%2Fui.c;h=02eecce54232aaa14b73110735f440dd76e1036c;hp=4242ac079946b19404748af24f7540a24cd6c7e3;hb=9240af1ae3159c7ba2f1ff1152089efd7fa5e38e;hpb=c8c562de07c5dcd2fd557ed100cf62a15140bbe4 diff --git a/lib/ui.c b/lib/ui.c index 4242ac0..02eecce 100644 --- a/lib/ui.c +++ b/lib/ui.c @@ -19,8 +19,8 @@ #include #include "ui.h" -#include "othello.h" #include "debug.h" +#include "list.h" /* in all print routine, y and x are the coordinates of the first character of the shape * which can be a space ' ' */ @@ -78,7 +78,7 @@ static void print_o(int y, int x, unsigned int type) { set_default_colors(); } -/* will be used for pawn placement hints */ +/* used for pawn placement hints */ static void print_x(int y, int x, unsigned int type) { if (type == hint_allowed) { @@ -129,6 +129,14 @@ void print_pawns(int base_y, int base_x, unsigned int pawn_array[board_size][boa } } +void print_shots_list(int base_y, int base_x, struct shots_list_s* shots_list) { + struct shots_list_s* list_counter; + + list_for_each_entry(list_counter, &shots_list->list, list) { + print_x(base_y + remap_y(list_counter->y), base_x + remap_x(list_counter->x), list_counter->type); + } +} + int map_col_letter_to_index(char c) { if (c == 'a' || c == 'A') {