From 4d6ea8d98d770e3f35c8ddbdd0d1aa2113251ecf Mon Sep 17 00:00:00 2001 From: "arthur.laine" Date: Wed, 12 Mar 2025 14:17:14 +0100 Subject: [PATCH] fonction totalPoints fini --- totalPoints.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/totalPoints.py b/totalPoints.py index c931c40..d4f918d 100644 --- a/totalPoints.py +++ b/totalPoints.py @@ -1,3 +1,17 @@ from traitement import traitement def totalPoints(joueur): - tb1 = traitement("stats.txt") \ No newline at end of file + """Fonction qui calcule le nombre total de points marqué par le joueur en paramètre""" + tb1 = traitement("stats.txt") + total_points = 0 + from points import points + from reussite import reussite + nb_essai_lancer, nb_lancer_réussi = reussite(joueur,"lancer")#points aux lancers + for i in range(len(tb1[0])): + if joueur == tb1[0][i] and tb1[1][i] == "tir-reussi": + total_points = total_points + points(tb1[2][i], tb1[3][i])#points en dehors des lancers + total_points = total_points + nb_lancer_réussi#points total + return total_points + + +#test = totalPoints("J42") +#print(test) \ No newline at end of file