import random
from colorama import init, Fore
init(autoreset=True)
choices = ["rock", "paper", "scissors"]
def get_winner(player, computer):
if player == computer:
return "draw"
elif (player == "rock" and computer == "scissors") or \\
(player == "scissors" and computer == "paper") or \\
(player == "paper" and computer == "rock"):
return "player"
else:
return "computer"
print(Fore.GREEN + "š® Welcome to Rock, Paper, Scissors!")
player_name = input("Enter your name: ")
player_score = 0
computer_score = 0
while True:
print(Fore.YELLOW + "\\nChoose one: rock, paper, or scissors")
player_choice = input("Your choice: ").lower()
if player_choice not in choices:
print(Fore.RED + "ā Invalid choice. Try again.")
continue
computer_choice = random.choice(choices)
print(Fore.CYAN + f"š¤ Computer chose: {computer_choice}")
result = get_winner(player_choice, computer_choice)
if result == "draw":
print(Fore.BLUE + "It's a draw!")
elif result == "player":
print(Fore.GREEN + "š You win this round!")
player_score += 1
else:
print(Fore.RED + "š» Computer wins this round!")
computer_score += 1
print(Fore.MAGENTA + f"Score ā {player_name}: {player_score} | Computer: {computer_score}")
again = input("\\nDo you want to play again? (yes/no): ").lower()
if again != "yes":
print(Fore.CYAN + f"\\nš Final Score ā {player_name}: {player_score} | Computer: {computer_score}")
if player_score \> computer_score:
print(Fore.GREEN + "š You are the overall winner!")
elif player_score \< computer_score:
print(Fore.RED + "š» Computer wins overall!")
else:
print(Fore.YELLOW + "It's a tie overall!"import random
from colorama import init, Fore
init(autoreset=True)
choices = ["rock", "paper", "scissors"]
def get_winner(player, computer):
if player == computer:
return "draw"
elif (player == "rock" and computer == "scissors") or \\
(player == "scissors" and computer == "paper") or \\
(player == "paper" and computer == "rock"):
return "player"
else:
return "computer"
print(Fore.GREEN + "š® Welcome to Rock, Paper, Scissors!")
player_name = input("Enter your name: ")
player_score = 0
computer_score = 0
while True:
print(Fore.YELLOW + "\\nChoose one: rock, paper, or scissors")
player_choice = input("Your choice: ").lower()
if player_choice not in choices:
print(Fore.RED + "ā Invalid choice. Try again.")
continue
computer_choice = random.choice(choices)
print(Fore.CYAN + f"š¤ Computer chose: {computer_choice}")
result = get_winner(player_choice, computer_choice)
if result == "draw":
print(Fore.BLUE + "It's a draw!")
elif result == "player":
print(Fore.GREEN + "š You win this round!")
player_score += 1
else:
print(Fore.RED + "š» Computer wins this round!")
computer_score += 1
print(Fore.MAGENTA + f"Score ā {player_name}: {player_score} | Computer: {computer_score}")
again = input("\\nDo you want to play again? (yes/no): ").lower()
if again != "yes":
print(Fore.CYAN + f"\\nš Final Score ā {player_name}: {player_score} | Computer: {computer_score}")
if player_score \> computer_score:
print(Fore.GREEN + "š You are the overall winner!")
elif player_score \< computer_score:
print(Fore.RED + "š» Computer wins overall!")
else:
print(Fore.YELLOW + "It's a tie overall!"import random
from colorama import init, Fore
init(autoreset=True)
choices = ["rock", "paper", "scissors"]
def get_winner(player, computer):
if player == computer:
return "draw"
elif (player == "rock" and computer == "scissors") or \\
(player == "scissors" and computer == "paper") or \\
(player == "paper" and computer == "rock"):
return "player"
else:
return "computer"
print(Fore.GREEN + "š® Welcome to Rock, Paper, Scissors!")
player_name = input("Enter your name: ")
player_score = 0
computer_score = 0
while True:
print(Fore.YELLOW + "\\nChoose one: rock, paper, or scissors")
player_choice = input("Your choice: ").lower()
if player_choice not in choices:
print(Fore.RED + "ā Invalid choice. Try again.")
continue
computer_choice = random.choice(choices)
print(Fore.CYAN + f"š¤ Computer chose: {computer_choice}")
result = get_winner(player_choice, computer_choice)
if result == "draw":
print(Fore.BLUE + "It's a draw!")
elif result == "player":
print(Fore.GREEN + "š You win this round!")
player_score += 1
else:
print(Fore.RED + "š» Computer wins this round!")
computer_score += 1
print(Fore.MAGENTA + f"Score ā {player_name}: {player_score} | Computer: {computer_score}")
again = input("\\nDo you want to play again? (yes/no): ").lower()
if again != "yes":
print(Fore.CYAN + f"\\nš Final Score ā {player_name}: {player_score} | Computer: {computer_score}")
if player_score \> computer_score:
print(Fore.GREEN + "š You are the overall winner!")
elif player_score \< computer_score:
print(Fore.RED + "š» Computer wins overall!")
else:
print(Fore.YELLOW + "It's a tie overall!"import random
from colorama import init, Fore
init(autoreset=True)
choices = ["rock", "paper", "scissors"]
def get_winner(player, computer):
if player == computer:
return "draw"
elif (player == "rock" and computer == "scissors") or \\
(player == "scissors" and computer == "paper") or \\
(player == "paper" and computer == "rock"):
return "player"
else:
return "computer"
print(Fore.GREEN + "š® Welcome to Rock, Paper, Scissors!")
player_name = input("Enter your name: ")
player_score = 0
computer_score = 0
while True:
print(Fore.YELLOW + "\\nChoose one: rock, paper, or scissors")
player_choice = input("Your choice: ").lower()
if player_choice not in choices:
print(Fore.RED + "ā Invalid choice. Try again.")
continue
computer_choice = random.choice(choices)
print(Fore.CYAN + f"š¤ Computer chose: {computer_choice}")
result = get_winner(player_choice, computer_choice)
if result == "draw":
print(Fore.BLUE + "It's a draw!")
elif result == "player":
print(Fore.GREEN + "š You win this round!")
player_score += 1
else:
print(Fore.RED + "š» Computer wins this round!")
computer_score += 1
print(Fore.MAGENTA + f"Score ā {player_name}: {player_score} | Computer: {computer_score}")
again = input("\\nDo you want to play again? (yes/no): ").lower()
if again != "yes":
print(Fore.CYAN + f"\\nš Final Score ā {player_name}: {player_score} | Computer: {computer_score}")
if player_score \> computer_score:
print(Fore.GREEN + "š You are the overall winner!")
elif player_score \< computer_score:
print(Fore.RED + "š» Computer wins overall!")
else:
print(Fore.YELLOW + "It's a tie overall!"import random
from colorama import init, Fore
init(autoreset=True)
choices = ["rock", "paper", "scissors"]
def get_winner(player, computer):
if player == computer:
return "draw"
elif (player == "rock" and computer == "scissors") or \\
(player == "scissors" and computer == "paper") or \\
(player == "paper" and computer == "rock"):
return "player"
else:
return "computer"
print(Fore.GREEN + "š® Welcome to Rock, Paper, Scissors!")
player_name = input("Enter your name: ")
player_score = 0
computer_score = 0
while True:
print(Fore.YELLOW + "\\nChoose one: rock, paper, or scissors")
player_choice = input("Your choice: ").lower()
if player_choice not in choices:
print(Fore.RED + "ā Invalid choice. Try again.")
continue
computer_choice = random.choice(choices)
print(Fore.CYAN + f"š¤ Computer chose: {computer_choice}")
result = get_winner(player_choice, computer_choice)
if result == "draw":
print(Fore.BLUE + "It's a draw!")
elif result == "player":
print(Fore.GREEN + "š You win this round!")
player_score += 1
else:
print(Fore.RED + "š» Computer wins this round!")
computer_score += 1
print(Fore.MAGENTA + f"Score ā {player_name}: {player_score} | Computer: {computer_score}")
again = input("\\nDo you want to play again? (yes/no): ").lower()
if again != "yes":
print(Fore.CYAN + f"\\nš Final Score ā {player_name}: {player_score} | Computer: {computer_score}")
if player_score \> computer_score:
print(Fore.GREEN + "š You are the overall winner!")
elif player_score \< computer_score:
print(Fore.RED + "š» Computer wins overall!")
else:
print(Fore.YELLOW + "It's a tie overall!")
print("š Thanks for playing!")
break)
print("š Thanks for playing!")
break)
print("š Thanks for playing!")
break)
print("š Thanks for playing!")
break)
print("š Thanks for playing!")
break