max_compliment

Authorcuriouscat
Submission date2012-12-21 04:27:08.421704
Rating1411
Matches played746
Win rate13.67

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

Source code:

def most_common(l):
    max = 0
    maxitem = None
    for x in set(l):
        count =  l.count(x)
        if count > max:
            max = count
            maxitem = x
    return maxitem

if input == "": # initialize variables for the first round
        history=''
        history += 'R'
history += input

guess=most_common(history)

if guess == "R":
	output = "S"
elif guess == "P":
	output = "R"
else:
	output = "P"