Author | Hash |
Submission date | 2011-07-07 22:36:22.031664 |
Rating | 6100 |
Matches played | 4395 |
Win rate | 56.31 |
Use rpsrunner.py to play unranked matches on your computer.
from random import choice
if input == '':
freq = dict.fromkeys('RPS', 1)
else:
freq[input] += 1
output = choice(''.join(k*v for k, v in freq.items()))
output = dict(R='P', P='S', S='R')[output]