Compare commits

..

No commits in common. 'ad40b548353dc3181c7ae0b5669054af3edbc45e' and 'e7fc298c8020f7ec301a346b036a5ca1c161e931' have entirely different histories.

17
sae.c

@ -234,8 +234,7 @@ int ChoiceActi(int nbacti, int *tacti)
chxacti = chx1 + chx2*10 ; chxacti = chx1 + chx2*10 ;
} }
else
if (nbacti == 3)
{ {
chx1 = Acti(nbacti-2); chx1 = Acti(nbacti-2);
chx2 = Acti(nbacti-1); chx2 = Acti(nbacti-1);
@ -259,18 +258,19 @@ void ChoiceMenu(char *choix)
} }
void CheckPts(int *tptsbonus, int *tptsbought, int *tpasseoupas, int *tacti, char *tcateg, int place, int acti, int *insuf) void CheckPts(int *tptsbonus, int *tptsbought, int *tpasseoupas, int place, int acti)
{ {
printf("%d\n", acti); int u , d, c, actu, actd, actc, ptsneeded;
int u , d, c, actu = 0, actd = 0, actc = 0, ptsneeded;
char confirm; char confirm;
u = acti % 10;//acti1 u = acti % 10;//acti1
d = (acti % 100 )/10 ;//acti2 d = (acti-u) / 10 ;//acti2
c = acti / 100;//acti3 c = acti / 100;//acti3
actu = CheckActi(u); actu = CheckActi(u);
printf
actd = CheckActi(d); actd = CheckActi(d);
actc = CheckActi(c); actc = CheckActi(c);
ptsneeded = actu + actd + actc; ptsneeded = actu + actd + actc;
printf("%d", ptsneeded);
if (ptsneeded <= tptsbought[place]) if (ptsneeded <= tptsbought[place])
{ {
@ -285,17 +285,14 @@ void CheckPts(int *tptsbonus, int *tptsbought, int *tpasseoupas, int *tacti, cha
tptsbought[place] += 15; tptsbought[place] += 15;
tptsbonus[place] -= 100; tptsbonus[place] -= 100;
} }
tacti[place] = acti;
} }
} }
else else
{ {
*insuf = 1; printf("J'y vais pas");
} }
} }
int CheckActi(int nb) int CheckActi(int nb)
{ {
if (nb == 1)//badminton if (nb == 1)//badminton

@ -10,4 +10,4 @@ int Acti(int i);
void ChoiceMenu(char *choix); void ChoiceMenu(char *choix);
int CheckActi(int nb); int CheckActi(int nb);
int FindN(int *tAd, int numAd, int *tpasseoupas, int tmax); int FindN(int *tAd, int numAd, int *tpasseoupas, int tmax);
void CheckPts(int *tptsbonus, int *tptsbought, int *tpasseoupas, int *tacti, char *tcateg, int place, int acti, int *insuf); void CheckPts(int *tptsbonus, int *tptsbought, int *tpasseoupas, int place, int acti);

@ -4,8 +4,8 @@
void main(void) void main(void)
{ {
int tAd[TAILLE], tage[TAILLE], tstate[TAILLE], tacti[TAILLE], tpasseoupas[TAILLE], tptsbought[TAILLE], tptsbonus[TAILLE], place, nbacti, chxacti, numAd, ret, insuf; int tAd[TAILLE], tage[TAILLE], tstate[TAILLE], tacti[TAILLE], tpasseoupas[TAILLE], tptsbought[TAILLE], tptsbonus[TAILLE], place, nbacti, chxacti, numAd, ret;
char tcateg[TAILLE], nom[TAILLE], pnom[TAILLE], fnom[TAILLE], fpnom[TAILLE], bCard, member, tnom[TAILLE][15], tpnom[TAILLE][15], action, choix, recharge; char tcateg[TAILLE], nom[TAILLE], pnom[TAILLE], fnom[TAILLE], fpnom[TAILLE], bCard, member, tnom[TAILLE][15], tpnom[TAILLE][15], action, choix;
Fillvar(tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500); Fillvar(tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
printf("Bienvenue ! \nMembre (M) | Création compte (C)\n"); printf("Bienvenue ! \nMembre (M) | Création compte (C)\n");
@ -76,30 +76,21 @@ void main(void)
} }
chxacti = ChoiceActi(nbacti, tacti); chxacti = ChoiceActi(nbacti, tacti);
CheckPts(tptsbonus, tptsbought, tpasseoupas, tacti, tcateg, place, chxacti, &insuf); CheckPts(tptsbonus, tptsbought, tpasseoupas, place, chxacti);
if (insuf == 1)
{
printf("Nombre de points insuffisants : Recharge (R) ou Quitter (Q)");
scanf("%*c%c%*c", &recharge);
if (recharge == 'R')
{
Recharge(tptsbought, place, tcateg);
}
else
{
ChoiceMenu(&choix);
}
}
tacti[place] = chxacti;
ChoiceMenu(&choix); ChoiceMenu(&choix);
} }
if (choix == 'Q') if (choix == 'Q')
{ {
//menuglobal() //menuglobal()
return; return;
} }
} }
}
}

Loading…
Cancel
Save