GG1

AuthorGary
Submission date2019-02-04 16:50:11.224165
Rating4352
Matches played252
Win rate40.87

Use rpsrunner.py to play unranked matches on your computer.

Source code:

R = 0;
P = 0;
S = 0;
str = []
if input == "": # initialize variables for the first round
	R = P = S = 0
elif input == "R":
    R += 1
    str.append("R")
elif input == "P":
    P += 1
    str.append("P")
elif input == "S":
    S += 1
    str.append("S")
temp=""
if(len(str)>=9):
    temp = str.pop(0)

elif temp == "R":
    R -= 1
elif temp == "P":
    P -= 1
elif temp == "S":
    S -= 1

if R > P and R > S:
	output = "P" # paper beats rock
elif P > S:
	output = "S" # scissors beats paper
else:
	output = "R" # rock beats scissors