From 50648604f95c1faf2adbcd9601271a2552ff8190 Mon Sep 17 00:00:00 2001 From: ykyliane Date: Mon, 8 Jun 2026 13:28:05 +0200 Subject: [PATCH] upadates --- pierre_feuille_ciseau.py | 83 ++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/pierre_feuille_ciseau.py b/pierre_feuille_ciseau.py index feac408..f352c0a 100644 --- a/pierre_feuille_ciseau.py +++ b/pierre_feuille_ciseau.py @@ -1,30 +1,63 @@ import random +score_p = 0 +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) #choix du joueur -option_player=input("choisissez :" "pierre, feuille , ciseaux ?") -#choix du bot -option_IA = random.choice(["pierre","feuille" , "ciseaux"]) -print(option_IA) -#creation des regle de victoire IA -if option_player == "pierre" and option_IA == "feuille": - print("IA a gagné !") -elif option_player == "feuille" and option_IA == "ciseaux": - print("IA a gagné !") -elif option_player == "ciseaux" and option_IA == "pierre": - print("IA a gagné !") +while tentative <= 5 and manche < max_manche and score_IA >= 0 and score_p >= 0: + option_player=input("choisissez :" "pierre, feuille , ciseaux : ") + #choix du bot + option_IA = random.choice(["pierre","feuille" , "ciseaux"]) + print(option_IA) + #creation des regle de victoire IA + 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) + 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("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) #condition victoire player -elif option_player == "pierre" and option_IA == "ciseaux": - print("Vous avez Gagné !") -elif option_player == "feuille" and option_IA == "pierre": - print("Vous avez Gagné !") -elif option_player == "ciseaux" and option_IA == "feuille": - print("Vous avez Gagné !") + 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) + 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) + 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) #condition d'égalité -elif option_player == "pierre" and option_IA == "pierre": - print("égalité !") -elif option_player == "feuille" and option_IA == "feuille": - print("égalité !") -elif option_player == "ciseaux" and option_IA == "ciseaux": - print("é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) + elif option_player == "feuille" and option_IA == "feuille" and tentative <= 5: + print("égalité !🤝") + print("le nouveau score est : Player👤:",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) #exception -else: - print("ERROR !!") \ No newline at end of file + continuer = str(input("Voulez vous continuer ? :")) + if continuer == "oui" and manche < max_manche: + manche = manche+1 + 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 !😁"]) + print(answer_IA2) + exit() + else: + print("ERROR !!❌") + exit()