234234

Author234234
Submission date2014-10-12 02:30:39.179034
Rating4882
Matches played539
Win rate48.98

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

Source code:

import random
trump = {'R': 'P', 'P': 'S', 'S': 'R'}
hist = ""

def get_move(hist):
    for k in range(len(hist)-1, 1, -1):
        m = hist.rfind(hist[-k:], 0, -1)
        if m != -1 : 
            return trump[hist[m+k]]
    return random.choice('RPS')

hist += input
output = get_move(hist)