From 7805a4c9a31f86a251d37f927e7f9be1739655a4 Mon Sep 17 00:00:00 2001 From: ykyliane Date: Mon, 8 Jun 2026 15:00:14 +0200 Subject: [PATCH] last-update --- pierre_feuille_ciseau.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pierre_feuille_ciseau.py b/pierre_feuille_ciseau.py index f352c0a..f013a47 100644 --- a/pierre_feuille_ciseau.py +++ b/pierre_feuille_ciseau.py @@ -4,8 +4,9 @@ score_IA = 0 tentative = 0 manche = 0 max_manche = 10 -print("BIENVENUE DANS 1,2,3 PIERRE FEUILLE CISEAUX 🎮") -print("le score est actuellement de :","Player👤 =",score_p,"et","IA 🤖 =",score_IA) +ID = input("veuillez saisir votre nom avant de commencer !") +print("BIENVENUE,DANS 1,2,3 PIERRE FEUILLE CISEAUX 🎮",ID) +print("le score est actuellement de :",ID,"👤 =",score_p,"et","IA 🤖 =",score_IA) #choix du joueur while tentative <= 5 and manche < max_manche and score_IA >= 0 and score_p >= 0: option_player=input("choisissez :" "pierre, feuille , ciseaux : ") @@ -16,43 +17,45 @@ while tentative <= 5 and manche < max_manche and score_IA >= 0 and score_p >= 0: if option_player == "pierre" and option_IA == "feuille" and tentative <= 5: print("IA a gagné !😊") score_IA = score_IA+1 - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) elif option_player == "feuille" and option_IA == "ciseaux" and tentative <= 5: score_IA = score_IA+1 - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) print("IA a gagné !😊") elif option_player == "ciseaux" and option_IA == "pierre" and tentative <= 5: print("IA a gagné !😊") score_IA = score_IA+1 - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) #condition victoire player elif option_player == "pierre" and option_IA == "ciseaux" and tentative <= 5: print("Vous avez Gagné !🎉") score_p = score_p+1 - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) elif option_player == "feuille" and option_IA == "pierre" and tentative <= 5: print("Vous avez Gagné !🎉") score_p = score_p+1 - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) elif option_player == "ciseaux" and option_IA == "feuille" and tentative <= 5: print("Vous avez Gagné 🎉") score_p = score_p+1 - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) #condition d'égalité elif option_player == "pierre" and option_IA == "pierre" and tentative <= 5: print("égalité !🤝") - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) elif option_player == "feuille" and option_IA == "feuille" and tentative <= 5: print("égalité !🤝") - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) elif option_player == "ciseaux" and option_IA == "ciseaux" and tentative <= 5: print("égalité🤝") - print("le nouveau score est : Player👤:",score_p,"IA🤖:",score_IA) + print("le nouveau score est :",ID,"👤:",score_p,"IA🤖:",score_IA) + if option_player not in ["pierre","feuille","ciseaux"] : + print("Choix Invalide❌") #exception continuer = str(input("Voulez vous continuer ? :")) if continuer == "oui" and manche < max_manche: manche = manche+1 - answer_IA1 = random.choice (["Fantastique !😊","Merveilleux !🎉", "Super !😁"]) + answer_IA1 = random.choice (["Fantastique !😊","Merveilleux !🎉", "Super !😁",]) print(answer_IA1) elif continuer == "non" : answer_IA2 = random.choice (["D'accord à Bientot !😊","C'était cool !😃", "A la prochaine !😁"])