From cc85a0c532c564058ce90f8ebedaa4f74873e98c Mon Sep 17 00:00:00 2001 From: "angel.barquin" Date: Fri, 7 Feb 2025 13:56:53 +0100 Subject: [PATCH 1/4] fonction reussite --- reussite.py | 27 +++++++++++++++++++++++---- stats.txt | 2 ++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/reussite.py b/reussite.py index 2eb9c73..b98ed93 100644 --- a/reussite.py +++ b/reussite.py @@ -1,9 +1,28 @@ 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 lst_joueur: - if joueur == lst_joueur[i]: - - \ No newline at end of file + for i in range(len(lst_joueur)): + if str(joueur) == str(lst_joueur[i]): + print(lst_action[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 \ No newline at end of file diff --git a/stats.txt b/stats.txt index c2f21a8..02107ab 100644 --- a/stats.txt +++ b/stats.txt @@ -195,3 +195,5 @@ J10V tir-reussi 64 258 J1 tir-manque 783 444 J3V tir-manque 44 317 J10V tir-reussi 61 278 +J42 tir-reussi 45 685 +J42 tir-manque 463 872 From 986b3ca698ca2e12c62ee171d243151e885ea5af Mon Sep 17 00:00:00 2001 From: "angel.barquin" Date: Fri, 7 Feb 2025 14:24:32 +0100 Subject: [PATCH 2/4] lalaal --- reussite.py | 1 - 1 file changed, 1 deletion(-) diff --git a/reussite.py b/reussite.py index b98ed93..9652bb1 100644 --- a/reussite.py +++ b/reussite.py @@ -11,7 +11,6 @@ def reussite(joueur, action): lst_action = tbl[1] for i in range(len(lst_joueur)): if str(joueur) == str(lst_joueur[i]): - print(lst_action[i]) if lst_action[i] == "tir-reussi": tenta_t +=1 reu_t +=1 From aa5b610a1acb7ebe90a4c45e077f7516ae9fdcad Mon Sep 17 00:00:00 2001 From: "arthur.laine" Date: Fri, 7 Feb 2025 14:33:57 +0100 Subject: [PATCH 3/4] ooooo --- afficheStats.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/afficheStats.py b/afficheStats.py index 9c20921..5034d53 100644 --- a/afficheStats.py +++ b/afficheStats.py @@ -1,3 +1,15 @@ from traitement import traitement -def afficheStats(joueur): - tb1 = traitement("stats.txt") \ No newline at end of file +from reussite import reussite +from rebondPasses 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_total:",rebond_totale,"Pourcentage_tir", pourcentage_tir,"%") + \ No newline at end of file From f8b41ff421a26b42ba30e3a760840701b7bfc23f Mon Sep 17 00:00:00 2001 From: "arthur.laine" Date: Fri, 7 Feb 2025 14:41:58 +0100 Subject: [PATCH 4/4] oooooo --- afficheStats.py | 4 ++-- rebondsPasse.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/afficheStats.py b/afficheStats.py index 5034d53..4e1cd10 100644 --- a/afficheStats.py +++ b/afficheStats.py @@ -1,6 +1,6 @@ from traitement import traitement from reussite import reussite -from rebondPasses import rebondPasses +from rebondsPasse import rebondPasses def afficheStats(joueur, tir): tb1 = traitement("stats") lst_joueur = tb1[0] @@ -11,5 +11,5 @@ def afficheStats(joueur, tir): pourcentage_tir = tir_reussi / tir_totale * 100 passe , rebondOff, rebondDef = rebondPasses(joueur) rebond_totale = rebondOff + rebondDef - return("Rebond_total:",rebond_totale,"Pourcentage_tir", pourcentage_tir,"%") + return rebond_totale, pourcentage_tir \ No newline at end of file diff --git a/rebondsPasse.py b/rebondsPasse.py index 03c8c2a..33b8cb1 100644 --- a/rebondsPasse.py +++ b/rebondsPasse.py @@ -15,5 +15,5 @@ def rebondPasses(joueur): rebondOff = rebondOff + 1 if action == "rebondDef": rebondDef = rebondDef +1 - return("Passe:",passe,"RebondOff:",rebondOff,"rebondDef:",rebondDef) + return passe, rebondOff, rebondDef \ No newline at end of file