FrequencyAnalysis[v3]

AuthorEmmanuel Harish Menon
Submission date2019-06-03 11:25:42.991846
Rating4575
Matches played215
Win rate46.05

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

Source code:

import random
import operator

pickCounter = {"R": 0, "P": 0, "S": 0}
winningMoves = {"R": "P", "P": "S", "S": "R"}

def getDictMax(dictionary):
    return max(dictionary.items(), key=operator.itemgetter(1))[0]

if input is "":
    output = random.choice(["R", "P", "S"])
else:
    pickCounter[input] += 1
    output = winningMoves[getDictMax(pickCounter)]