Author | Vladimir Del |
Submission date | 2013-08-28 05:45:27.708260 |
Rating | 3988 |
Matches played | 652 |
Win rate | 37.73 |
Use rpsrunner.py to play unranked matches on your computer.
import random
p = input.count("P")
r = input.count("R")
s = input.count("S")
if p > r and p > s:
output = "P"
if r > p and r > s:
output = "R"
if s > p and s > r:
output = "S"
if p == r and p == s :
output = random.choice(["R", "P", "S"])
if p == r:
output = random.choice(["R", "P"])
if p == s:
output = random.choice(["S", "P"])
if s == r:
output = random.choice(["R", "S"])