X-Git-Url: https://git.piment-noir.org/?p=Project_algorithmic_C.git;a=blobdiff_plain;f=lib%2Fui.c;h=c786772620be4e78df055a277c8f5507e78f989f;hp=c5f83b7be7f05a2e4192b69f2ec2387d9f3945a6;hb=2e5c189444a82df0d9127c94322ec4e3b159dcce;hpb=4ddf6f1a0411ed147ba7a2ac178c186ebef374b5 diff --git a/lib/ui.c b/lib/ui.c index c5f83b7..c786772 100644 --- a/lib/ui.c +++ b/lib/ui.c @@ -51,35 +51,43 @@ void print_board(int y, int x) { mvprintw(y+22, x, " -----+----+----+----+----+----+----+-----"); } -static void print_x(int y, int x, int type) { - - mvprintw(y, x, "\\/"); - mvprintw(y+1, x,"/\\"); -} - static void print_o(int y, int x, int type) { mvprintw(y, x, "/\\"); mvprintw(y+1, x, "\\/"); } -/* y = 1: y -> 0 x = 1: 1 -> 1 - * y > 2: y -> y + 3 2 -> +6 */ +/* will be used for pawn placement hints */ +static void print_x(int y, int x, int type) { + + mvprintw(y, x, "\\/"); + mvprintw(y+1, x,"/\\"); +} +/* 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 0; } else if (y > 1) { - return y + 3; + return (remap_y(y -1) + 3); } } static int remap_x(int x) { if (x == 1) { - return 1; - } else if (x > 2) { - return x + 5; + return x; + } else if (x > 1) { + return (remap_x(x - 1) + 5); + } +} + +void print_pawns(int pawn_array[board_size][board_size]) { + for (int i = 0; i < board_size; i++) { + for (int j = 0; j < board_size; j++) { + //mvprintw(i, j, "pawn[%d][%d] = %d\n", i, j, pawn_array[i][j]); + } } }