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 ;
}
if (nbacti == 3)
else
{
chx1 = Acti(nbacti-2);
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 = 0, actd = 0, actc = 0, ptsneeded;
int u , d, c, actu, actd, actc, ptsneeded;
char confirm;
u = acti % 10;//acti1
d = (acti % 100 )/10 ;//acti2
d = (acti-u) / 10 ;//acti2
c = acti / 100;//acti3
actu = CheckActi(u);
printf
actd = CheckActi(d);
actc = CheckActi(c);
ptsneeded = actu + actd + actc;
printf("%d", ptsneeded);
if (ptsneeded <= tptsbought[place])
{
@ -285,17 +285,14 @@ void CheckPts(int *tptsbonus, int *tptsbought, int *tpasseoupas, int *tacti, cha
tptsbought[place] += 15;
tptsbonus[place] -= 100;
}
tacti[place] = acti;
}
}
else
{
*insuf = 1;
printf("J'y vais pas");
}
}
int CheckActi(int nb)
{
if (nb == 1)//badminton

@ -10,4 +10,4 @@ int Acti(int i);
void ChoiceMenu(char *choix);
int CheckActi(int nb);
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)
{
int tAd[TAILLE], tage[TAILLE], tstate[TAILLE], tacti[TAILLE], tpasseoupas[TAILLE], tptsbought[TAILLE], tptsbonus[TAILLE], place, nbacti, chxacti, numAd, ret, insuf;
char tcateg[TAILLE], nom[TAILLE], pnom[TAILLE], fnom[TAILLE], fpnom[TAILLE], bCard, member, tnom[TAILLE][15], tpnom[TAILLE][15], action, choix, recharge;
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;
Fillvar(tAd, tnom, tpnom, tage, tstate, tacti, tpasseoupas, tptsbought, tptsbonus, tcateg, 500);
printf("Bienvenue ! \nMembre (M) | Création compte (C)\n");
@ -15,7 +15,7 @@ void main(void)
printf("Saisir un caractère correct (Membre M ou Création C)\n");
scanf("%*c%c%*c", &member);
}
bCard = Card();//demande si carte avec client ou non
@ -76,30 +76,21 @@ void main(void)
}
chxacti = ChoiceActi(nbacti, tacti);
CheckPts(tptsbonus, tptsbought, tpasseoupas, tacti, tcateg, place, chxacti, &insuf);
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);
}
}
CheckPts(tptsbonus, tptsbought, tpasseoupas, place, chxacti);
tacti[place] = chxacti;
ChoiceMenu(&choix);
}
}
if (choix == 'Q')
{
//menuglobal()
return;
}
}
}
}

Loading…
Cancel
Save