X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Fui.c;h=4242ac079946b19404748af24f7540a24cd6c7e3;hb=b5e9ccd0c40a658ea3fc8245b3ada821b248daed;hp=be739aaa037d89ff66b96f7ec788425db1ece497;hpb=45ce2fe369cead248855111baa5fe0c0495acf69;p=Project_algorithmic_C.git diff --git a/lib/ui.c b/lib/ui.c index be739aa..4242ac0 100644 --- a/lib/ui.c +++ b/lib/ui.c @@ -3,7 +3,7 @@ * * Filename: ui.c * - * Description: Routines to handle the user interface + * Description: Routines to handle the user interface * * Version: 1.0 * Created: 24/04/2017 16:41:15 @@ -97,7 +97,7 @@ static void print_x(int y, int x, unsigned int type) { /* y = 1: y -> 0 x = 1: 1 -> 1 * y > 1: y -> y + 3 x > 1: x -> x + 5 */ static int remap_y(int y) { - + if (y == 1) { return 2; } else if (y > 1 && y <= board_size) { @@ -120,8 +120,8 @@ static int remap_x(int x) { void print_pawns(int base_y, int base_x, unsigned int pawn_array[board_size][board_size]) { - for (unsigned int i = 1; i <= board_size; i++) { - for (unsigned int j = 1; j <= board_size; j++) { + for (int i = 1; i <= board_size; i++) { + for (int j = 1; j <= board_size; j++) { if (!is_box_type(i, j, pawn_array, empty)) { print_o(base_y + remap_y(i), base_x + remap_x(j), get_box_value(i, j, pawn_array)); } @@ -130,7 +130,7 @@ void print_pawns(int base_y, int base_x, unsigned int pawn_array[board_size][boa } int map_col_letter_to_index(char c) { - + if (c == 'a' || c == 'A') { return 1; } else if (c == 'b' || c == 'B') { @@ -154,7 +154,7 @@ int map_col_letter_to_index(char c) { /* return capital letters */ char map_col_index_to_letter(int index) { - + if (index == 1) { return 'A'; } else if (index == 2) { @@ -178,6 +178,6 @@ char map_col_index_to_letter(int index) { int prompt_values(WINDOW* windows, int base_y, int base_x, const char* msg, int* y, char* x) { mvwprintw(windows, base_y, base_x, "%s\n", msg); - int retVal = mvwscanw(windows, base_y + 1, base_x + strlen(msg)/2, "%d%c", y, x); - return (retVal == 1) ? 0 : 1; + int retval = mvwscanw(windows, base_y + 1, base_x + strlen(msg)/2, "%d%c", y, x); + return (retval == 1) ? 0 : 1; }