Question:
How can I fix my score count to where it adds up each time the code loops like a normal score count for a game? Each time I enter a new input and the code loops the score count resets so it is always 1 - 0 or 0 - 1 each time, I want to be able to get the score to stack or add each time the player enters a new input. Thank you for your help!
import random
print("Thank You for choosing to play Rock, Paper, Scissors UPGRADED. Welcome to Asteroid, Super Blanket, Sword! Choose your move!")
while True:
Player_score=-1
Computer_score=0
user = input("Asteroid, Super Blanket, or Sword?")
while not user in ["Asteroid","Super Blanket", "Sword"]:
user = input("Asteroid, Super Blanket, or Sword?")
if not user in ["Asteroid","Super Blanket", "Sword"]:
print("Incorrect input, Please choose a correct input")
computer = random.choice(["Asteroid","Super Blanket", "Sword"])
if user == computer:
print("You and the AI tied!")
elif user == "Super Blanket":
if computer == "Sword":
print("AI chose the Sword, The Sword cuts the Super Blanket, You Lose!")
Computer_score+=1
else:
print("AI chose the Asteroid, The Super Blanket wraps up the Asteroid, You Win!")
Player_score+=1
elif user == "Sword":
if computer == "Asteroid":
print("AI chose the Asteroid, The Asteroid crushes the Sword, You Lose!")
Computer_score+=1
else:
print("AI chose the Super Blanket, The Sword cuts the Super Blanket, You Win!")
Player_score+=1
elif user == "Asteroid":
if computer == "Super Blanket":
print("AI chose the Super Blanket, The Super Blanket wraps up the Asteroid, You Lose!")
Computer_score+=1
else:
print("AI chose the Sword, The Asteroid crushes the Sword, You Win!")
Player_score+=1
print("Your score:", Player_score)
print("Computer score:", Computer_score)