1 changed files with 31 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||
|
|||
# petit test pour être sûr d'avoir le bon fichier |
|||
# et transformer chaque ligne en liste |
|||
with open("stats.txt", "r") as f: |
|||
for lignes in f: |
|||
lst_clean = lignes.strip() |
|||
lst_ligne = lst_clean.split() |
|||
#print(lst_ligne) |
|||
|
|||
|
|||
|
|||
# fonction pour déterminer nombre de points d'un tir |
|||
def points(x, y): |
|||
|
|||
# regarde si le lancer et dans demi-cercle gauche |
|||
# sinon demi - cercle droite et sinon c'est que le tir est fait en dehors |
|||
if x <= 300 and 50<=y<=550: |
|||
return 2 |
|||
elif x>= 700 and 50<=y<=550: |
|||
return 2 |
|||
else: |
|||
return 3 |
|||
|
|||
|
|||
print(points(200, 100)) # test1 |
|||
print(points(800, 100)) # test2 |
|||
print(points(500, 700)) # test3 |
|||
|
|||
|
|||
|
|||
|
Loading…
Reference in new issue