def score

Authorgobang
Submission date2011-07-06 15:03:14.024690
Rating2174
Matches played4304
Win rate17.29

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

Source code:

scoring = {
    "R": {
        "R": 0,
        "P": -1,
        "S": 1
    },
    "P": {
        "R": 1,
        "P": 0,
        "S": -1
    },
    "S": {
        "R": -1,
        "P": 1,
        "S": 0
    }
}
output = "S"
if input:
  for k,v in scoring[input].iteritems() :
    if v == 1:
      output = k