You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
738 B
27 lines
738 B
from traitement import traitement
|
|
def reussite(joueur, action):
|
|
"""
|
|
"""
|
|
reu_l=0
|
|
tenta_l=0
|
|
reu_t=0
|
|
tenta_t=0
|
|
tbl = traitement("stats")
|
|
lst_joueur = tbl[0]
|
|
lst_action = tbl[1]
|
|
for i in range(len(lst_joueur)):
|
|
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
|