naive

Authorbrad
Submission date2011-05-25 18:08:12.645374
Rating1495
Matches played7296
Win rate13.09

Use rpsrunner.py to play unranked matches on your computer.

Source code:

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]