diff --git a/cheat.c b/cheat.c index 4f2d468..11e888f 100644 --- a/cheat.c +++ b/cheat.c @@ -3,7 +3,7 @@ #include #include "cheat.h" -int cheat(int affichage[50],int tab[40], int sauv_pos[80], int im_x, int im_y){ +int cheat(char affichage[50],int tab[40], int sauv_pos[80], int im_x, int im_y){ int x,n,pos_x,pos_y; int i, oui; while(n<1){ diff --git a/cheat.h b/cheat.h index 7dc18de..598a128 100644 --- a/cheat.h +++ b/cheat.h @@ -1,6 +1,6 @@ #ifndef CHEAT_H #define CHEAT_H -int cheat(int affichage[50],int tab[40], int sauv_pos[80], int im_x, int im_y); +int cheat(char affichage[50],int tab[40], int sauv_pos[80], int im_x, int im_y); #endif \ No newline at end of file diff --git a/images.c b/images.c index 01aea18..751f50e 100644 --- a/images.c +++ b/images.c @@ -7,9 +7,8 @@ #include "jeu.h" int tirage_aleatoire(int nb_paires){ - InitialiserGraphique(); char tirage[50]; - int pos_x, pos_y, clic_x, clic_y, im_y, im_x; + int pos_x, pos_y; int i, j; int nb,score; int tab[40]; @@ -63,23 +62,5 @@ int tirage_aleatoire(int nb_paires){ i++; } } - - - /*for (i=0;i<19;i++){ - printf("%03d", i); - printf(" "); - } - printf("\n"); - for (j=0;j<4;j++){ - for (i=0;i<20;i++){ - printf("%03d", positions[i][j]); - printf(" "); - } - printf("\n"); - } - for (i=0;i<40;i++){ - printf("%d\n",tab[i]); - }*/ - score=jeu(positions, nb_paires,tab); } diff --git a/jeu.c b/jeu.c index e792813..7fc9404 100644 --- a/jeu.c +++ b/jeu.c @@ -9,12 +9,12 @@ #include "rejouer.h" int jeu(int position[20][4], int nb_paires,int tab[40]){ - int score=0,score2,repet,test=0; + int score=0,score2,repet; int pos_x,pos_y,oui; int i,j,g,l=0,n=0,x=0,stock_g_1,stock_g_2,sauv_pos[80]; int repet2, nb_images; int a; - int clic_x,clic_y,im_y,im_x, im_x_1, im_x_2, im_y_1, im_y_2,xpos,ypos; + int clic_x,clic_y,im_x, im_x_1, im_x_2, im_y, im_y_1, im_y_2,xpos,ypos; unsigned long temps, temps2,temps3=1; char tempstab[50],affichage[50],scoretab[50]; @@ -199,6 +199,10 @@ int jeu(int position[20][4], int nb_paires,int tab[40]){ if((xpos>=760 && xpos<=986) && (ypos>=460 && ypos<=504)){ a=rejouer(); } + if((xpos>=950 && xpos<=1002) && (ypos>=15 && ypos<=78)){ + FermerGraphique(); + return EXIT_SUCCESS; + } } } FermerGraphique(); diff --git a/main.c b/main.c index 094672d..aa13f1a 100644 --- a/main.c +++ b/main.c @@ -10,7 +10,6 @@ int main(void){ InitialiserGraphique(); CreerFenetre(0,0,1024,576); - int temps,coucou; int nb_paires=menu(); tirage_aleatoire(nb_paires); } \ No newline at end of file