Hi, I am putting some simple Python challenges together for my high school class. I have this challenge for a simple rock, paper, scissors game. I want to run an automatic test (input/output - Match) but part of the program is the computer generates a random number between 1 and 3 for an input. How can I represent that in the input field? Or should I not be using Match?
The solution program is here. How do I test it?
print ("----ROCK, PAPER, SCISSORS----") import random #generates a random number between 1 and 3 computer=random.randint(1,3) #asks the user to input their choice and stores it in a variable user=int(input("Enter your choice:\n1=Rock\n2=Paper\n3=Scissors\n")) #outputs the computer's move print("The computer has chosen",computer) #outputs a different string depending on the outcome of the game if computer==user: print ("Tie game") elif computer==1 and user==3: print ("Computer wins") elif computer==2 and user==1: print ("Computer wins") elif computer==3 and user==2: print ("Computer wins") else: print ("You Win!")