Author | brad |
Submission date | 2011-05-25 18:08:12.645374 |
Rating | 1492 |
Matches played | 7322 |
Win rate | 13.1 |
Use rpsrunner.py to play unranked matches on your computer.
if input == '':
history = { 'R': 0, 'P': 0, 'S': 0 }
output = 'R'
else:
history[input] += 1
_, c = min((history[c], c) for c in 'RPS')
output = { 'R': 'P', 'P': 'S', 'S': 'R' }[c]