max_of_latest_3

Authorcuriouscat
Submission date2012-12-20 19:11:06.616398
Rating2372
Matches played785
Win rate23.18

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 += 'P'
        history += 'S'


history += input

output=most_common(history[-3:-1])