Author | jacket |
Submission date | 2017-12-04 17:31:55.003890 |
Rating | 4916 |
Matches played | 315 |
Win rate | 48.89 |
Use rpsrunner.py to play unranked matches on your computer.
import random
countRock = 0
countPaper = 0
countScissors = 0
input = [] #This is the user's input as string
##########Checks the User's overall preference of r, p or s
if len(input)%8 == 0:
if countRock > countPaper and countRock > countScissors:
output = "P" #paper beats rock
if countRock < countPaper < countScissors:
output = "R" #rock beats scissors
if countRock < countPaper > countScissors:
output = "S" #scissors beats paper
else:
output = random.choice(["R","P","S"]) #randomized!