NSRv3

AuthorWDIFTL
Submission date2011-06-09 20:40:20.046232
Rating3723
Matches played5398
Win rate33.81

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

Source code:

import random

game = ["R","P","S"]

if input=="":
  history = list()
  guess = list()
  output = random.choice(game)
  
else:
  guess = list()
  history.append(input)
  count = [history.count("R"),history.count("P"),history.count("S")]
  
  i = -1
  try:
    while 1:
      i = count.index(max(count), i+1)
      guess.append(i)
  except ValueError:
    pass
  
  output = game[(random.choice(guess)+1)%3]