From 876eb3721771aba75158040243ffbc41fff3e523 Mon Sep 17 00:00:00 2001 From: proal Date: Thu, 1 Dec 2022 23:53:31 +0100 Subject: [PATCH] =?UTF-8?q?une=20paire=20compl=C3=A9t=C3=A9e=20ne=20peut?= =?UTF-8?q?=20plus=20=C3=AAtre=20retourn=C3=A9e=20une=20autre=20fois=20(ma?= =?UTF-8?q?is=20est=20masqu=C3=A9e)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeu.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/jeu.c b/jeu.c index 6b9cb34..ddd6b55 100644 --- a/jeu.c +++ b/jeu.c @@ -13,9 +13,8 @@ int jeu(int position[20][4], int nb_paires){ int repet2, nb_images; int clic_x,clic_y,im_y,im_x; unsigned long temps, temps2,temps3; - char tempstab[50],affichage[50];; - char* comparer1[50], comparer2[50]; - int tab[3]; + char tempstab[50],affichage[50]; + int tab[3], ban_list[20]; couleur c=CouleurParComposante(0,0,0); temps2=Microsecondes(); @@ -80,14 +79,14 @@ int jeu(int position[20][4], int nb_paires){ if (position[i][(j*2)]==im_x && position[i][(j*2+1)]==im_y){ if (repet==0){ g=i+1; - snprintf(comparer1,50,"Images/image%d.png",g); - ChargerImage(comparer1,im_x,im_y,0,0,80,80); + snprintf(affichage,50,"Images/image%d.png",g); + ChargerImage(affichage,im_x,im_y,0,0,80,80); stock_g_1=g; } else{ g=i+1; - snprintf(comparer2,50,"Images/image%d.png",g); - ChargerImage(comparer2,im_x,im_y,0,0,80,80); + snprintf(affichage,50,"Images/image%d.png",g); + ChargerImage(affichage,im_x,im_y,0,0,80,80); stock_g_2=g; } repet++; @@ -101,6 +100,10 @@ int jeu(int position[20][4], int nb_paires){ printf("%d\n", im_y);*/ if (stock_g_1==stock_g_2){ score++; + position[stock_g_1-1][0]=0; + position[stock_g_1-1][1]=0; + position[stock_g_1-1][2]=0; + position[stock_g_1-1][3]=0; } repet2=0; if (score!=nb_paires){ @@ -117,7 +120,6 @@ int jeu(int position[20][4], int nb_paires){ } } } - Touche(); FermerGraphique(); return 1; } \ No newline at end of file