From d07587c654e84979455010ad01dfccb18db67ba3 Mon Sep 17 00:00:00 2001 From: alberr_b0yyy Date: Thu, 12 Jun 2025 13:33:05 +0200 Subject: [PATCH] finalisation de la selection --- main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index fb9dcb5..969caef 100644 --- a/main.c +++ b/main.c @@ -2,6 +2,7 @@ #include #include #include +#include #define FG_DEFAULT_BG_WHITE "\x1b[30;48;5;255m" #define FG_DEFAULT_BG_136 "\x1b[30;48;5;136m" @@ -111,7 +112,7 @@ int print_tab() { return 0; } -int piece_selection() { +void piece_selection() { if (y % 2 == 1) { if (x % 2 == 0) { @@ -129,12 +130,10 @@ int piece_selection() { printf(FG_DEFAULT_BG_136"\x1b[%d;%dH%s", y - y_direction + 1 , (x - x_direction) * 2 + 1, piece_to_str(board[y - y_direction][x - x_direction])); } } - - - printf("\x1b[%d;%dH\x1b[39;49ma", y + 1 , x * 2 + 1); + printf("\x1b[%d;%dH\x1b[39;106m%s", y + 1 , x * 2 + 1, piece_to_str(board[y][x])); } -int controls() { +void controls() { piece_selection(); @@ -194,10 +193,12 @@ int controls() { piece_selection(); } break; + case 113: + printf("\x1b[?25h"); + exit(0); default: break; } } - return 0; } int main() {