least played

Authorbrad
Submission date2011-05-26 20:25:44.269525
Rating2333
Matches played7012
Win rate18.23

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

Source code:

import random

if input == '':
  history = { 'R': 0, 'P': 0, 'S': 0 }
  output = random.choice(['R', 'P', 'S'])

else:
  history[input] += 1
  c, _ = sorted((k, v) for k, v in history.items())[0]
  output = { 'R': 'P', 'P': 'S', 'S': 'R' }[c]