Author | Dhaivat Pandya |
Submission date | 2011-08-08 06:47:15.346459 |
Rating | 3579 |
Matches played | 3479 |
Win rate | 33.66 |
Use rpsrunner.py to play unranked matches on your computer.
if input=="":
history = []
c = {"R":0, "P":0, "S":0}
output = "R"
else:
history.append(input)
c[input] += 1
if c["R"] > c["P"] and c["R"] > c["S"]:
output = "P"
if c["S"] > c["R"] and c["S"] > c["P"]:
output = "R"
if c["P"] > c["S"] and c["P"] > c["R"]:
output = "S"