Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import os, sys
- rejouer = True
- point = 0
- score_pc = 0
- while rejouer:
- chiffre = random.randrange(1, 4)
- print("""
- \t 1 = pierre
- \t 2 = feuille
- \t 3 = ciseaux """)
- joueur = input("Entrer votre choix :")
- joueur = int(joueur)
- if joueur == chiffre:
- print("Vous etes à égaliter !!")
- elif joueur == 1 and chiffre == 2:
- print("L'ordinateur a choisie la feuille. Vous avez perdu... ")
- score_pc = score_pc + 1
- elif joueur == 1 and chiffre == 3:
- print("L'ordinateur à choisier les ciseaux. Vous avez gagné !!!")
- point = point + 1
- elif joueur == 2 and chiffre == 1:
- print("L'ordinateur à choisie la pierre. Vous avez gagné !!")
- point = point + 1
- elif joueur == 2 and chiffre == 3:
- print("L'ordinateur à choisie les ciseaux. Vous avez perdu ...")
- score_pc = score_pc + 1
- elif joueur == 3 and chiffre == 1:
- print("L'ordinateur à choisie la pierre. Vous avez perdu ...")
- score_pc = score_pc + 1
- elif joueur == 3 and chiffre == 2:
- print("L'ordinateur à choisie la feuille. Vous avez gagné !!")
- point = point + 1
- else:
- print("je n'est pas compris ")
- print(f"Vous avez gagnée {point} contre {score_pc} pour l'ordinateur")
- question = input("Voulez vous rejouer ? (o/n) :")
- if question == "n":
- rejouer = False
- os.system("pause")
- sys.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement