Trial A

Authorrockadidas
Submission date2014-10-11 05:59:18.202245
Rating5038
Matches played566
Win rate50.0

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

Source code:

import random

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

def winner(opponent_tactic):
    return tactics[(tactics.index(opponent_tactic) + 1) % 3]

hist = ""

if input == "":
    output = random.choice(tactics)

else:
    hist = hist + input
    output = winner(hist[-1])