From 7cfa6e09db5204c044d0c6894ceeff00e4469b98 Mon Sep 17 00:00:00 2001 From: proal Date: Mon, 28 Nov 2022 16:55:10 +0100 Subject: [PATCH] suite et presque fin --- images.c | 83 +++++++++++++++++++++----------------------------------- 1 file changed, 31 insertions(+), 52 deletions(-) diff --git a/images.c b/images.c index fcb58a3..45da310 100644 --- a/images.c +++ b/images.c @@ -4,78 +4,57 @@ #include #include "images.h" -/*int aleatoire(int* tab[40]){ - int nb; - int position[20][4]; - nb=rand()%20; - if (position[nb][0]<10){ - position[nb][0]=pos_x; - position[nb][1]=pos_y; - return nb; - } - else if (position[nb][2]<10){ - position[nb][2]=pos_x; - position[nb][3]=pos_y; - return nb; - } - else{ - aleatoire(pos_x, pos_y); - } - - - return tab[40]; -}*/ - int main(void){ - /*InitialiserGraphique(); + InitialiserGraphique(); ChoisirEcran(0); - CreerFenetre(0,0,1024,576);*/ + CreerFenetre(0,0,1024,576); char tirage[50]; - int tire; int pos_x, pos_y; - int i, j, n; + int i, j; int nb; - /*int position[20][4];*/ int tab[40]; + int nb_paires; - //ChargerImage("Images/background.png",0,0,0,0,1024,576); + printf("Combien de paires ? --> "); + scanf("%d", &nb_paires); + + ChargerImage("Images/background.png",0,0,0,0,1024,576); + + for (i=0;i<40;i++){ + tab[i]=0; + } - j=1; - n=1; srand(time(NULL)); - for (i=0;i<40;i++){ - nb=rand()%40; - while (tab[nb]==0){ - nb++; - if (nb==20){ - nb=0; + for (i=0;i<2;i++){ + for (j=0;j