From 64c6be969eda2ddd8a1fc18c74017f5b6631d2a9 Mon Sep 17 00:00:00 2001 From: NeelSaxena42 Date: Mon, 6 Oct 2025 13:33:28 +0530 Subject: [PATCH] few changes --- Rock_Paper_Scissors/main.py | 74 +++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/Rock_Paper_Scissors/main.py b/Rock_Paper_Scissors/main.py index a804d57..fd83233 100644 --- a/Rock_Paper_Scissors/main.py +++ b/Rock_Paper_Scissors/main.py @@ -1,30 +1,64 @@ import random +import time +import os + +lose_game = [ + "Oops! That didn't go well.", + "Better luck next time!", + "The computer strikes again!", + "You got outplayed!", + "That was embarrassing... for you.", +] + options = ("rock", "paper", "scissors") -wins=0 -losses=0 -ties=0 -tries=0 -running=True +wins = 0 +losses = 0 +ties = 0 +tries = 0 +running = True + while running: - player=None - computer=random.choice(options) + player = None + computer = random.choice(options) + while player not in options: - player=input("Pick a choice: rock, paper, scissors? ").lower() + player = input("Pick a choice: rock, paper, scissors? ").lower() + + time.sleep(0.5) + print("Rock...") + time.sleep(0.5) + print("Paper...") + time.sleep(0.5) + print("Scissors...") + time.sleep(0.5) + print("Shoot!") + time.sleep(0.5) + print(f"computer: {computer}") print(f"player: {player}") - if player==computer: + + if player == computer: print("It's a tie") - ties+=1 - elif (player=="rock" and computer=="scissors") or (player=="paper" and computer=="rock") or (player=="scissors" and computer=="paper"): + ties += 1 + elif (player == "rock" and computer == "scissors") or \ + (player == "paper" and computer == "rock") or \ + (player == "scissors" and computer == "paper"): print("yayy! you win") - wins+=1 - elif (player=="rock" and computer=="paper") or (player=="paper" and computer=="scissors") or (player=="scissors" and computer=="rock"): + wins += 1 + else: print("Oh no! you lose") - losses+=1 - tries+=1 + print(random.choice(lose_game)) + losses += 1 + + tries += 1 print("Do you want to play again? (y/n)") - answer=input().lower() - if answer!="y": - running=False -print("Thank you for playing!") -print(f"Final Score: Wins: {wins}, Losses: {losses}, Ties: {ties}, Tries: {tries}") \ No newline at end of file + answer = input().lower() + if answer != "y": + running = False + +print(f"Final Score: Wins: {wins}, Losses: {losses}, Ties: {ties}, Tries: {tries}") +if wins > losses: + print("You are the winner! Congratulations!") +else: + print(random.choice(lose_game)) +print("Thank you for playing!") \ No newline at end of file