pipe-game

Un jeu de cartes à piper les une dans les autres - retour accueil

git clone git://bebou.netlib.re/pipe-game
Log | Files | Refs | README |

commit 8245a91175a35614a802221d7a4e80ba13f19f53
parent 41c9b59d706888db212dac91ed16de8d6c80f9be
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Wed, 22 Jan 2025 18:26:06 +0100

Correction bug mentionné dans le commit précédent

Honnêtement je comprends pas assez ce que je fais pour savoir pouquoir
strcpy c'était pas ok mais un simple = l'est.

Diffstat:
Minterface.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/interface.c b/interface.c @@ -57,8 +57,8 @@ bool addcardtopile(char* cardname, pile* p, pile **piles) { return false; if(p->name=="played") addcardtopile("none",piles[PLAYEDARGS],piles); - if(p->name=="playedargs" && cardname!="none") - strcpy(p->cards[p->cardCount-1], cardname); + if(p->name=="playedargs" && strcmp(cardname,"none")!=0) + p->cards[p->cardCount-1]=cardname; else { p->cards[p->cardCount] = malloc(CARD_NAME_SIZE); strcpy(p->cards[p->cardCount], cardname); @@ -207,6 +207,9 @@ void display(pile** piles, pile curmenu, bool selection, char* cmd, char* res, c tb_printf(0,30,TB_DEFAULT,TB_DEFAULT,curmenu.name); char str[100];sprintf(str,"%d",curmenu.cardCount); tb_printf(0,31,TB_DEFAULT,TB_DEFAULT,str); + char str2[100]; + sprintf(str2,"%d",curmenu.curline); + tb_printf(0,32,TB_DEFAULT,TB_DEFAULT,str2); tb_present(); return; }