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.
29 lines
882 B
29 lines
882 B
2 weeks ago
|
from fonction_points import points
|
||
|
def totalPoints (joueur):
|
||
|
total_pts = 0
|
||
|
with open("stats.txt") as stats:
|
||
|
for ligne in stats :
|
||
|
ligne=ligne.strip() #nettoyage des lignes
|
||
|
lst_elements = ligne.split(' ') #decoupage sur les espaces
|
||
|
|
||
|
if lst_elements[0] == joueur :
|
||
|
|
||
|
if lst_elements[1]=="tir-reussi":
|
||
|
x = lst_elements[2]
|
||
|
y = lst_elements[3]
|
||
|
#print(lst_elements[0],lst_elements[1],x,y)
|
||
|
total_pts = total_pts + points(x,y)
|
||
|
#print(points(x,y))
|
||
|
|
||
|
return total_pts
|
||
|
|
||
|
|
||
|
"""tests"""
|
||
|
for i in range (1,11):
|
||
|
joueur = "J" + str(i)
|
||
|
print(joueur,totalPoints(joueur))
|
||
|
|
||
|
for i in range (1,11):
|
||
|
joueur = "J" + str(i) + "V"
|
||
|
print(joueur,totalPoints(joueur))
|