Author | oezi |
Submission date | 2012-10-16 09:03:13.431622 |
Rating | 4395 |
Matches played | 767 |
Win rate | 41.07 |
Use rpsrunner.py to play unranked matches on your computer.
# my first attempt for the RPScontest, and the first time every using python
import random
if input == "":
r = p = s = 0
elif input == "R":
r += 1
elif input == "P":
p += 1
elif input == "S":
s += 1
ra = ["R"] * r
pa = ["P"] * p
sa = ["S"] * s
if input == "":
output = random.choice(["R","P","S"])
else:
output = random.choice(ra + pa + sa)