4 changed files with 39 additions and 7 deletions
@ -1,3 +1,15 @@ |
|||||
from traitement import traitement |
from traitement import traitement |
||||
def afficheStats(joueur): |
from reussite import reussite |
||||
tb1 = traitement("stats.txt") |
from rebondsPasse import rebondPasses |
||||
|
def afficheStats(joueur, tir): |
||||
|
tb1 = traitement("stats") |
||||
|
lst_joueur = tb1[0] |
||||
|
lst_action = tb1[1] |
||||
|
#points_marque = 0 |
||||
|
rebond_totale = 0 |
||||
|
tir_totale , tir_reussi = reussite(joueur, tir) |
||||
|
pourcentage_tir = tir_reussi / tir_totale * 100 |
||||
|
passe , rebondOff, rebondDef = rebondPasses(joueur) |
||||
|
rebond_totale = rebondOff + rebondDef |
||||
|
return rebond_totale, pourcentage_tir |
||||
|
|
@ -1,9 +1,27 @@ |
|||||
from traitement import traitement |
from traitement import traitement |
||||
def reussite(joueur, action): |
def reussite(joueur, action): |
||||
|
""" |
||||
|
""" |
||||
|
reu_l=0 |
||||
|
tenta_l=0 |
||||
|
reu_t=0 |
||||
|
tenta_t=0 |
||||
tbl = traitement("stats") |
tbl = traitement("stats") |
||||
lst_joueur = tbl[0] |
lst_joueur = tbl[0] |
||||
lst_action = tbl[1] |
lst_action = tbl[1] |
||||
for i in lst_joueur: |
for i in range(len(lst_joueur)): |
||||
if joueur == lst_joueur[i]: |
if str(joueur) == str(lst_joueur[i]): |
||||
|
if lst_action[i] == "tir-reussi": |
||||
|
tenta_t +=1 |
||||
|
reu_t +=1 |
||||
|
elif lst_action[i] == "tir-manque": |
||||
|
tenta_t +=1 |
||||
|
if lst_action[i] == "lancer-reu": |
||||
|
tenta_l +=1 |
||||
|
reu_l +=1 |
||||
|
elif lst_action[i] == "lancer-rat" : |
||||
|
tenta_l +=1 |
||||
|
if action == "lancer": |
||||
|
return tenta_l, reu_l |
||||
|
else: |
||||
|
return tenta_t, reu_t |
Loading…
Reference in new issue