BOneHundred

AuthorTheCrouchMode
Submission date2016-01-15 12:37:51.133233
Rating4515
Matches played441
Win rate44.67

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

Source code:

import random
import collections

size = 3

try:
    prev
except NameError:
    prev = collections.deque([])

output = ""

if input == "":
    for i in range(size):
        prev.append(random.choice(["R", "P", "S"]))
    output = random.choice(["R", "P", "S"]);
else:
    prev.appendleft(input)
    prev.pop()
    guess = random.choice(prev)
    
    if guess == "R":
        output = "P"
    elif guess == "P":
        output = "S"
    elif guess == "S":
        output = "R"