naive

Authorbrad
Submission date2011-05-25 18:08:12.645374
Rating1492
Matches played7322
Win rate13.1

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]