Un outil pour réarranger les lignes de stdin - retour accueil
git clone git://bebou.netlib.re/reorder
Log | Files | Refs | README |
commit 3753ff931b04720648d2080c03d28f81894cfa48 parent bb78ba3f03a8f7d2a9eca814259a1ef29b993b66 Auteurice: Arthur Pons <arthur.pons@unistra.fr> Date: Fri, 17 Jan 2025 16:41:43 +0100 Utilisation de CARD_NAME_SIZE 10 c'est maybe short Diffstat:
M | reorder.c | | | 10 | +++++----- |
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/reorder.c b/reorder.c @@ -7,7 +7,7 @@ #define LIST_SIZE 1000 /* Le chiffre c'est des octets. Les caractères sont encodés sur un octet chacun ? * Donc si on met 5 la taille max serait 4 caractères ? */ -#define CARD_NAME_SIZE 20 +#define CARD_NAME_SIZE 10 struct pile { @@ -74,17 +74,17 @@ void display(struct pile* h, struct pile* p, int handcurline, int playedcurline, else { tb_printf(0, i, TB_DEFAULT, TB_BLACK, h->cards[i]); } } for (int w=0;w<max(p->cardCount,h->cardCount);w++) { - tb_printf(10,w,TB_DEFAULT, TB_BLACK, "|"); + tb_printf(CARD_NAME_SIZE,w,TB_DEFAULT, TB_BLACK, "|"); } for (j=0;j<p->cardCount;j++) { if (j==playedcurline && curmenu=="played") { if (selection) { - tb_printf(10+2, j, TB_BLACK, TB_BLUE, p->cards[j]); + tb_printf(CARD_NAME_SIZE+2, j, TB_BLACK, TB_BLUE, p->cards[j]); } else { - tb_printf(10+2, j, TB_BLACK, TB_WHITE, p->cards[j]); + tb_printf(CARD_NAME_SIZE+2, j, TB_BLACK, TB_WHITE, p->cards[j]); } } - else { tb_printf(10+2, j, TB_DEFAULT, TB_BLACK, p->cards[j]); } + else { tb_printf(CARD_NAME_SIZE+2, j, TB_DEFAULT, TB_BLACK, p->cards[j]); } } tb_present(); }