Author | tryer |
Submission date | 2011-07-02 07:07:51.390438 |
Rating | 3297 |
Matches played | 4675 |
Win rate | 36.26 |
Use rpsrunner.py to play unranked matches on your computer.
if input == "": # initialize variables for the first round
rC = pC = sC = 0
elif input == "R":
rC += 1
elif input == "P":
pC += 1
elif input == "S":
sC += 1
if rC > pC and rC > sC:
output = "P" # paper beats rock
elif pC > sC and pC > rC:
output = "S" # scissors beats paper
elif sC > pC and sC > rC:
output = "R" # rock beats scissors
elif rC==pC and pC==sC:
output = "P"
elif rC==pC and sC==rC:
output = "R"
elif pC==sC and sC==rC:
output = "S"