1 changed files with 28 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||
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)) |
Loading…
Reference in new issue